Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1058181 - oo-admin-usage will not show the usage of deleted gears
Summary: oo-admin-usage will not show the usage of deleted gears
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Pod
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Ravi Sankar
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-27 07:42 UTC by Meng Bo
Modified: 2015-05-15 00:24 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-02-26 19:10:33 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Meng Bo 2014-01-27 07:42:42 UTC
Description of problem:
oo-admin-usage cannot show the gear usage after gear was deleted.

Version-Release number of selected component (if applicable):
devenv-stage_655

How reproducible:
always

Steps to Reproduce:
1. Create some gears 
2. Check the gears usage on broker via oo-admin-usage
3. Delete some of the gears
4. Check the usage again

Actual results:
oo-admin-usage can only get usage of the existing gears.

Expected results:
The usage of deleted gears should also be shown by the tool.

Additional info:
The delete usage can be listed via "oo-admin-ctl-usage --list"

[root@ip-10-151-24-134 openshift]# oo-admin-ctl-usage --list
Errors/Warnings will be logged to terminal
2014-01-27 01:55:13 -0500 INFO:: 
---------- STARTED ----------

User: bmeng@redhat.com
	Gear: 52e5fd2b76e77d31a4000007, UsageType: ADDTL_FS_GB, Usage: 1 minutes and 24 seconds
	Gear: 52e5fd2b76e77d31a4000007, UsageType: GEAR_USAGE, Usage: 23 minutes and 9 seconds
	Gear: 52e5fd2b76e77d31a4000007, UsageType: PREMIUM_CART, Usage: 23 minutes and 9 seconds
	Gear: 52e5fec476e77d31a400001f, UsageType: GEAR_USAGE, Usage: 4 minutes and 19 seconds
	Gear: 52e5fecd76e77d7156000001, UsageType: GEAR_USAGE, Usage: 4 minutes and 22 seconds
	Gear: 52e6004576e77d7156000044, UsageType: GEAR_USAGE, Usage: 24 seconds
2014-01-27 01:55:13 -0500 INFO:: 
---------- ENDED, #Errors: 0, #Warnings: 0 ----------


Result of oo-admin-usage:

# oo-admin-usage -l bmeng@redhat.com

Usage for bmeng@redhat.com (Plan: silver)
-------------------
#1
 Usage Type: GEAR_USAGE (small)
    Gear ID: 52e5fd2b76e77d31a4000007 (jbeap1)
   Duration: 19 minutes and 32 seconds (2014-01-27 06:32:03 - PRESENT)
Cost (Est.): $0.01 ($0.02/hour)

#2
 Usage Type: PREMIUM_CART (jbosseap-6)
    Gear ID: 52e5fd2b76e77d31a4000007 (jbeap1)
   Duration: 19 minutes and 32 seconds (2014-01-27 06:32:04 - PRESENT)
Cost (Est.): $0.01 ($0.03/hour)

Comment 1 Jianwei Hou 2014-01-27 07:52:23 UTC
Caused by an mongo operator error in oo-admin-usage:

- filter["$or"] = [{"end_time" => nil}, {"end_time" => {"gte" => start_time}}] if start_time
+ filter["$or"] = [{"end_time" => nil}, {"end_time" => {"$gte" => start_time}}] if start_time

Comment 2 Ravi Sankar 2014-01-28 07:18:09 UTC
Fixed in https://github.com/openshift/origin-server/pull/4601

Comment 3 openshift-github-bot 2014-01-28 08:21:32 UTC
Commits pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/2296f52f731b21803493b0031603ad30764f43d6
Bug 1058181 - Fix query filter in oo-admin-usage

https://github.com/openshift/origin-server/commit/c0e5856386307d0354b606d59d5cbe457ce5ee21
Merge pull request #4601 from pravisankar/dev/ravi/bug1058181

Merged by openshift-bot

Comment 5 Meng Bo 2014-01-28 11:27:44 UTC
Issue fixed on devenv_4290, usage info for delete gears can be shown.

[root@domU-12-31-39-07-D6-8C ~]# oo-admin-usage -l bmeng

Usage for bmeng (Plan: free)
-------------------
#1
 Usage Type: GEAR_USAGE (small)
    Gear ID: 52e791237bb0ee4ace000007 (app1)
   Duration: 1 minutes and 27 seconds (2014-01-28 11:15:06 - 2014-01-28 11:16:33)

#2
 Usage Type: GEAR_USAGE (small)
    Gear ID: 52e791527bb0ee0890000001 (app2)
   Duration: 1 minutes and 17 seconds (2014-01-28 11:15:51 - 2014-01-28 11:17:08)


Move bug to verified.


Note You need to log in before you can comment on or make changes to this bug.