Bug 1010372

Summary: oo-admin-ctl-usage doesn't give hints to unit used
Product: OpenShift Online Reporter: Nam Duong <nduong>
Component: PodAssignee: Ravi Sankar <rpenta>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.xCC: jhou, jofernan, xtian, zzhao
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-17 13:30:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nam Duong 2013-09-20 16:03:42 UTC
Description of problem:
See https://www.openshift.com/forums/openshift/oo-admin-ctl-usage

1)  oo-admin-ctl-usage -l dmp | grep abcdefg
Gear: abcdefg, UsageType: GEAR_USAGE, Usage: 670.9346516100759

Would be good to show units in the output.  


2) oo-admin-ctl-usage --help

Would be good to include in --help docs as well  


--- here's the current help---
== Synopsis

oo-admin-ctl-usage: Control usage

== Usage

oo-admin-ctl-usage OPTIONS

Options:
--list
    List usage available to be synced
--sync
    Sync usage with the billing vendor
--remove-sync-lock
    Remove existing sync lock
--enable-logger
    Print error/warning messages to log file '/var/log/openshift/broker/usage-billing.log' instead of terminal.
-h|--help
    Show Usage info

Comment 1 Abhishek Gupta 2013-09-24 19:31:53 UTC
Feel free to refer oo-admin-usage for output formatting.

Comment 2 Ravi Sankar 2013-09-26 20:44:57 UTC
Fixed in https://github.com/openshift/origin-server/pull/3715

<example-output>
[root@ip-10-32-53-49 ~]# oo-admin-ctl-usage --list
Errors/Warnings will be logged to terminal
2013-09-26 16:39:36 -0400 INFO:: 
---------- STARTED ----------

User: ravip
        Gear: 5244985e1a1664073d000007, UsageType: GEAR_USAGE, Usage: 13 minutes and 23 seconds
        Gear: 52449b5c1a1664073d000020, UsageType: GEAR_USAGE, Usage: 38 seconds
2013-09-26 16:39:36 -0400 INFO:: 
---------- ENDED, #Errors: 0, #Warnings: 0 ----------
</example-output>

Comment 4 Jianwei Hou 2013-09-29 11:30:30 UTC
Verified on devenv_3844
[root@ip-10-4-29-190 ~]# oo-admin-ctl-usage --list
Errors/Warnings will be logged to terminal
2013-09-29 06:52:15 -0400 INFO:: 
---------- STARTED ----------

User: openshift+migration3
	Gear: 524795f418568ca6340005f0, UsageType: GEAR_USAGE, Usage: 1 hours and 58 minutes
	Gear: 5247962618568ca634000612, UsageType: GEAR_USAGE, Usage: 1 hours and 21 minutes
	Gear: 5247964518568ca634000630, UsageType: GEAR_USAGE, Usage: 1 hours and 58 minutes
	Gear: 5247966518568ca634000649, UsageType: GEAR_USAGE, Usage: 1 hours and 58 minutes
	Gear: 5247968418568ca634000667, UsageType: GEAR_USAGE, Usage: 1 hours and 58 minutes
	Gear: 524796b318568ca63400068e, UsageType: GEAR_USAGE, Usage: 1 hours and 58 minutes
	Gear: 524796d518568ca6340006ab, UsageType: GEAR_USAGE, Usage: 1 hours and 58 minutes
	Gear: 524796d518568ca6340006ab, UsageType: PREMIUM_CART, Usage: 1 hours and 58 minutes
	Gear: 5247971918568ca6340006d6, UsageType: GEAR_USAGE, Usage: 1 hours and 58 minutes
..........