Bug 854924 - ovirt-engine-cli: show / list statistic command issues
Summary: ovirt-engine-cli: show / list statistic command issues
Keywords:
Status: CLOSED DUPLICATE of bug 855749
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-cli
Version: 3.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Michael Pasternak
QA Contact: Oded Ramraz
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-06 10:19 UTC by Oded Ramraz
Modified: 2016-02-10 19:28 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-09-10 07:53:22 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Oded Ramraz 2012-09-06 10:19:17 UTC
Description of problem:

There are two options to retrieve entity statistics :
1. using show statistic : retrieve the first ( single ) statistic entity. 
2. using list statistic : retrieve all statistics entities for an object 

1. I don't understand the purpose of 1 , and I think we can remove it from optional entities to display. 
2. Default format for list and show is different : show statistic output is the format of list statistic --show-all ( example 2,3 below )
3. When using show statistic --show-all I see many fields with empty values that related to host entity ( see Additional Information example4 ) 
4. list statistics does not show the actual value of the statistic entity by default ( example1 )

Those examples might be relevant for other objects / entities as well. 

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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:


## example 1 

[RHEVM shell (connected)]# list statistics --host-identifier puma32

id         : 7816602b-c05c-3db7-a4da-3769f7ad8896
name       : memory.total
description: Total memory

id         : b7499508-c1c3-32f0-8174-c1783e57bb08
name       : memory.used
description: Used memory

id         : 5a0fba9d-33d7-3cbf-addd-ba462040c946
name       : memory.free
description: Free memory

id         : ffc0e1fd-fa34-3f85-9862-8a841c1658bc
name       : memory.shared
description: Shared memory

id         : c81c86f0-bc61-3c78-a543-898b8339d03f
name       : memory.buffers
description: IO buffers

id         : 1b6244ee-8dbd-365d-8762-482ddc05ee11
name       : memory.cached
description: OS caches

## example 2 


[RHEVM shell (connected)]# list statistics --host-identifier puma32 --show-all 

id                : 7816602b-c05c-3db7-a4da-3769f7ad8896
name              : memory.total
description       : Total memory
host-id           : d3560912-f2ad-11e1-8f5f-001a4a169798
type              : GAUGE
unit              : BYTES
values-type       : INTEGER
values-value-datum: 33658241024.0

id                : b7499508-c1c3-32f0-8174-c1783e57bb08
name              : memory.used
description       : Used memory
host-id           : d3560912-f2ad-11e1-8f5f-001a4a169798
type              : GAUGE
unit              : BYTES
values-type       : INTEGER
values-value-datum: 8414560256.0

id                : 5a0fba9d-33d7-3cbf-addd-ba462040c946
name              : memory.free
description       : Free memory
host-id           : d3560912-f2ad-11e1-8f5f-001a4a169798
type              : GAUGE
unit              : BYTES
values-type       : INTEGER
values-value-datum: 25243680768.0

id                : ffc0e1fd-fa34-3f85-9862-8a841c1658bc
name              : memory.shared
description       : Shared memory
host-id           : d3560912-f2ad-11e1-8f5f-001a4a169798
type              : GAUGE
unit              : BYTES
values-type       : INTEGER
values-value-datum: 0.0



### show statistic 

## example 3 

[RHEVM shell (connected)]# show statistic --host-identifier puma32

id                : 7816602b-c05c-3db7-a4da-3769f7ad8896
name              : memory.total
description       : Total memory
host-id           : d3560912-f2ad-11e1-8f5f-001a4a169798
type              : GAUGE
unit              : BYTES
values-type       : INTEGER
values-value-datum: 33658241024.0


## example4 

[RHEVM shell (connected)]# show statistic --host-identifier puma32 --show-all 

id                            : 7816602b-c05c-3db7-a4da-3769f7ad8896
name                          : memory.total
description                   : Total memory
actions                       : 
creation_status               : 
disk                          : 
extensiontype                 : 
host-id                       : d3560912-f2ad-11e1-8f5f-001a4a169798
host-name                     : 
host-description              : 
host-actions                  : 
host-address                  : 
host-certificate              : 
host-cluster                  : 
host-cpu                      : 
host-creation_status          : 
host-extensiontype            : 
host-iscsi                    : 
host-ksm                      : 
host-memory                   : 
host-override_iptables        : 
host-port                     : 
host-power_management         : 
host-reboot_after_installation: 
host-root_password            : 
host-statistics               : 
host-status                   : 
host-storage_manager          : 
host-summary                  : 
host-transparent_hugepages    : 
host-type                     : 
host-version                  : 
host_nic                      : 
nic                           : 
type                          : GAUGE
unit                          : BYTES
values-type                   : INTEGER
values-value-datum            : 33658241024.0
vm                            :

Comment 3 Michael Pasternak 2012-09-06 10:49:04 UTC
(In reply to comment #0)
> Description of problem:
> 
> There are two options to retrieve entity statistics :
> 1. using show statistic : retrieve the first ( single ) statistic entity.

this is *NOT* correct, /show command NOT use to retrieve the first ( single )  entity, please read help[1]/wiki[2]/user-guide[3]

[1] [oVirt shell (connected)]# help show

[2] http://wiki.ovirt.org/wiki/CLI#show

[3] http://file.bne.redhat.com/~dmacpher/RHEV/CLI_Guide/Show_a_Resource_show.html
 
> 2. using list statistic : retrieve all statistics entities for an object 
> 
> 1. I don't understand the purpose of 1 , and I think we can remove it from
> optional entities to display. 

if you have N x objects (and engine search not available on this collection),
how would you get N-1 object? scrolling to the end?

using 'show x x-id' you will get it right away

show vm yy
show disk xxx --vm-identifier yyy

> 2. Default format for list and show is different : show statistic output is
> the format of list statistic --show-all ( example 2,3 below )

yes, as /show command meant to show the *single* entity, while
/list to list available entities, please read documentation.

> 3. When using show statistic --show-all I see many fields with empty values
> that related to host entity ( see Additional Information example4 ) 

--show-all in /list shows all properties except id/name/desc as they
showed by default, in /show command showed all not empty properties, doing --show-all in show command will show all existent properties of the object (even if they empty), there is *NO* need to use --sho-all if you do not
plan seeing *all* available object's properties

and cli does not add any fields, they exist as statistics object has host
inside, this is api resources arch.

> 4. list statistics does not show the actual value of the statistic entity by
> default ( example1 )

it designed to work this way, if you have 100000 items in list displaying
all properties by default would create endless list ...., this why you 
see only identification properties and if you want to see entire entity
use *explicitly* --show-all option

> 
> Those examples might be relevant for other objects / entities as well. 
> 
> Version-Release number of selected component (if applicable):
> 
> 
> How reproducible:
> 
> 
> Steps to Reproduce:
> 1.
> 2.
> 3.
>   
> Actual results:
> 
> 
> Expected results:
> 
> 
> Additional info:
> 
> 
> ## example 1 
> 
> [RHEVM shell (connected)]# list statistics --host-identifier puma32
> 
> id         : 7816602b-c05c-3db7-a4da-3769f7ad8896
> name       : memory.total
> description: Total memory
> 
> id         : b7499508-c1c3-32f0-8174-c1783e57bb08
> name       : memory.used
> description: Used memory
> 
> id         : 5a0fba9d-33d7-3cbf-addd-ba462040c946
> name       : memory.free
> description: Free memory
> 
> id         : ffc0e1fd-fa34-3f85-9862-8a841c1658bc
> name       : memory.shared
> description: Shared memory
> 
> id         : c81c86f0-bc61-3c78-a543-898b8339d03f
> name       : memory.buffers
> description: IO buffers
> 
> id         : 1b6244ee-8dbd-365d-8762-482ddc05ee11
> name       : memory.cached
> description: OS caches
> 
> ## example 2 
> 
> 
> [RHEVM shell (connected)]# list statistics --host-identifier puma32
> --show-all 
> 
> id                : 7816602b-c05c-3db7-a4da-3769f7ad8896
> name              : memory.total
> description       : Total memory
> host-id           : d3560912-f2ad-11e1-8f5f-001a4a169798
> type              : GAUGE
> unit              : BYTES
> values-type       : INTEGER
> values-value-datum: 33658241024.0
> 
> id                : b7499508-c1c3-32f0-8174-c1783e57bb08
> name              : memory.used
> description       : Used memory
> host-id           : d3560912-f2ad-11e1-8f5f-001a4a169798
> type              : GAUGE
> unit              : BYTES
> values-type       : INTEGER
> values-value-datum: 8414560256.0
> 
> id                : 5a0fba9d-33d7-3cbf-addd-ba462040c946
> name              : memory.free
> description       : Free memory
> host-id           : d3560912-f2ad-11e1-8f5f-001a4a169798
> type              : GAUGE
> unit              : BYTES
> values-type       : INTEGER
> values-value-datum: 25243680768.0
> 
> id                : ffc0e1fd-fa34-3f85-9862-8a841c1658bc
> name              : memory.shared
> description       : Shared memory
> host-id           : d3560912-f2ad-11e1-8f5f-001a4a169798
> type              : GAUGE
> unit              : BYTES
> values-type       : INTEGER
> values-value-datum: 0.0
> 
> 
> 
> ### show statistic 
> 
> ## example 3 
> 
> [RHEVM shell (connected)]# show statistic --host-identifier puma32
> 
> id                : 7816602b-c05c-3db7-a4da-3769f7ad8896
> name              : memory.total
> description       : Total memory
> host-id           : d3560912-f2ad-11e1-8f5f-001a4a169798
> type              : GAUGE
> unit              : BYTES
> values-type       : INTEGER
> values-value-datum: 33658241024.0
> 
> 
> ## example4 
> 
> [RHEVM shell (connected)]# show statistic --host-identifier puma32
> --show-all 
> 
> id                            : 7816602b-c05c-3db7-a4da-3769f7ad8896
> name                          : memory.total
> description                   : Total memory
> actions                       : 
> creation_status               : 
> disk                          : 
> extensiontype                 : 
> host-id                       : d3560912-f2ad-11e1-8f5f-001a4a169798
> host-name                     : 
> host-description              : 
> host-actions                  : 
> host-address                  : 
> host-certificate              : 
> host-cluster                  : 
> host-cpu                      : 
> host-creation_status          : 
> host-extensiontype            : 
> host-iscsi                    : 
> host-ksm                      : 
> host-memory                   : 
> host-override_iptables        : 
> host-port                     : 
> host-power_management         : 
> host-reboot_after_installation: 
> host-root_password            : 
> host-statistics               : 
> host-status                   : 
> host-storage_manager          : 
> host-summary                  : 
> host-transparent_hugepages    : 
> host-type                     : 
> host-version                  : 
> host_nic                      : 
> nic                           : 
> type                          : GAUGE
> unit                          : BYTES
> values-type                   : INTEGER
> values-value-datum            : 33658241024.0
> vm                            :

Comment 5 Oded Ramraz 2012-09-06 11:18:38 UTC
(In reply to comment #3)
> (In reply to comment #0)
> > Description of problem:
> > 
> > There are two options to retrieve entity statistics :
> > 1. using show statistic : retrieve the first ( single ) statistic entity.
> 
> this is *NOT* correct, /show command NOT use to retrieve the first ( single
> )  entity, please read help[1]/wiki[2]/user-guide[3]
> 
> [1] [oVirt shell (connected)]# help show
> 
> [2] http://wiki.ovirt.org/wiki/CLI#show
> 
> [3]
> http://file.bne.redhat.com/~dmacpher/RHEV/CLI_Guide/Show_a_Resource_show.html
>  
> > 2. using list statistic : retrieve all statistics entities for an object 
> > 
> > 1. I don't understand the purpose of 1 , and I think we can remove it from
> > optional entities to display. 
> 
> if you have N x objects (and engine search not available on this collection),
> how would you get N-1 object? scrolling to the end?
> 

I agree here , but the default format should be same for both IMO ( it was same for select / get in powershell as well )

> using 'show x x-id' you will get it right away
> 
> show vm yy
> show disk xxx --vm-identifier yyy
> 
> > 2. Default format for list and show is different : show statistic output is
> > the format of list statistic --show-all ( example 2,3 below )
> 
> yes, as /show command meant to show the *single* entity, while
> /list to list available entities, please read documentation.

We tried , but it is not so updated and contain some errors. 

> 
> > 3. When using show statistic --show-all I see many fields with empty values
> > that related to host entity ( see Additional Information example4 ) 
> 
> --show-all in /list shows all properties except id/name/desc as they
> showed by default, in /show command showed all not empty properties, doing
> --show-all in show command will show all existent properties of the object
> (even if they empty), there is *NO* need to use --sho-all if you do not
> plan seeing *all* available object's properties
> 
> and cli does not add any fields, they exist as statistics object has host
> inside, this is api resources arch.

Seeing host related fields for statistic object is not acceptable. 

> 
> > 4. list statistics does not show the actual value of the statistic entity by
> > default ( example1 )
> 
> it designed to work this way, if you have 100000 items in list displaying
> all properties by default would create endless list ...., this why you 
> see only identification properties and if you want to see entire entity
> use *explicitly* --show-all option

I think that the value is most important field for statistic object , even for reduced display. 

> 
> > 
> > Those examples might be relevant for other objects / entities as well. 
> > 
> > Version-Release number of selected component (if applicable):
> > 
> > 
> > How reproducible:
> > 
> > 
> > Steps to Reproduce:
> > 1.
> > 2.
> > 3.
> >   
> > Actual results:
> > 
> > 
> > Expected results:
> > 
> > 
> > Additional info:
> > 
> > 
> > ## example 1 
> > 
> > [RHEVM shell (connected)]# list statistics --host-identifier puma32
> > 
> > id         : 7816602b-c05c-3db7-a4da-3769f7ad8896
> > name       : memory.total
> > description: Total memory
> > 
> > id         : b7499508-c1c3-32f0-8174-c1783e57bb08
> > name       : memory.used
> > description: Used memory
> > 
> > id         : 5a0fba9d-33d7-3cbf-addd-ba462040c946
> > name       : memory.free
> > description: Free memory
> > 
> > id         : ffc0e1fd-fa34-3f85-9862-8a841c1658bc
> > name       : memory.shared
> > description: Shared memory
> > 
> > id         : c81c86f0-bc61-3c78-a543-898b8339d03f
> > name       : memory.buffers
> > description: IO buffers
> > 
> > id         : 1b6244ee-8dbd-365d-8762-482ddc05ee11
> > name       : memory.cached
> > description: OS caches
> > 
> > ## example 2 
> > 
> > 
> > [RHEVM shell (connected)]# list statistics --host-identifier puma32
> > --show-all 
> > 
> > id                : 7816602b-c05c-3db7-a4da-3769f7ad8896
> > name              : memory.total
> > description       : Total memory
> > host-id           : d3560912-f2ad-11e1-8f5f-001a4a169798
> > type              : GAUGE
> > unit              : BYTES
> > values-type       : INTEGER
> > values-value-datum: 33658241024.0
> > 
> > id                : b7499508-c1c3-32f0-8174-c1783e57bb08
> > name              : memory.used
> > description       : Used memory
> > host-id           : d3560912-f2ad-11e1-8f5f-001a4a169798
> > type              : GAUGE
> > unit              : BYTES
> > values-type       : INTEGER
> > values-value-datum: 8414560256.0
> > 
> > id                : 5a0fba9d-33d7-3cbf-addd-ba462040c946
> > name              : memory.free
> > description       : Free memory
> > host-id           : d3560912-f2ad-11e1-8f5f-001a4a169798
> > type              : GAUGE
> > unit              : BYTES
> > values-type       : INTEGER
> > values-value-datum: 25243680768.0
> > 
> > id                : ffc0e1fd-fa34-3f85-9862-8a841c1658bc
> > name              : memory.shared
> > description       : Shared memory
> > host-id           : d3560912-f2ad-11e1-8f5f-001a4a169798
> > type              : GAUGE
> > unit              : BYTES
> > values-type       : INTEGER
> > values-value-datum: 0.0
> > 
> > 
> > 
> > ### show statistic 
> > 
> > ## example 3 
> > 
> > [RHEVM shell (connected)]# show statistic --host-identifier puma32
> > 
> > id                : 7816602b-c05c-3db7-a4da-3769f7ad8896
> > name              : memory.total
> > description       : Total memory
> > host-id           : d3560912-f2ad-11e1-8f5f-001a4a169798
> > type              : GAUGE
> > unit              : BYTES
> > values-type       : INTEGER
> > values-value-datum: 33658241024.0
> > 
> > 
> > ## example4 
> > 
> > [RHEVM shell (connected)]# show statistic --host-identifier puma32
> > --show-all 
> > 
> > id                            : 7816602b-c05c-3db7-a4da-3769f7ad8896
> > name                          : memory.total
> > description                   : Total memory
> > actions                       : 
> > creation_status               : 
> > disk                          : 
> > extensiontype                 : 
> > host-id                       : d3560912-f2ad-11e1-8f5f-001a4a169798
> > host-name                     : 
> > host-description              : 
> > host-actions                  : 
> > host-address                  : 
> > host-certificate              : 
> > host-cluster                  : 
> > host-cpu                      : 
> > host-creation_status          : 
> > host-extensiontype            : 
> > host-iscsi                    : 
> > host-ksm                      : 
> > host-memory                   : 
> > host-override_iptables        : 
> > host-port                     : 
> > host-power_management         : 
> > host-reboot_after_installation: 
> > host-root_password            : 
> > host-statistics               : 
> > host-status                   : 
> > host-storage_manager          : 
> > host-summary                  : 
> > host-transparent_hugepages    : 
> > host-type                     : 
> > host-version                  : 
> > host_nic                      : 
> > nic                           : 
> > type                          : GAUGE
> > unit                          : BYTES
> > values-type                   : INTEGER
> > values-value-datum            : 33658241024.0
> > vm                            :

Comment 6 Oded Ramraz 2012-09-06 12:40:16 UTC
We can fail show statistic command if no name is passed with error: statistic name required , this will make it more clear. 

[RHEVM shell (connected)]# show statistic  --host-identifier puma31 

id                : 7816602b-c05c-3db7-a4da-3769f7ad8896
name              : memory.total
description       : Total memory
host-id           : 6315fc24-f812-11e1-ab6a-001a4a169798
type              : GAUGE
unit              : BYTES
values-type       : INTEGER
values-value-datum: 33658241024.0

Comment 7 Oded Ramraz 2012-09-10 06:30:03 UTC
We agreed to :
1. remove show-all option from show command 
2. Raise an error if specific parameter is not specified ( see comment 6 for example , name should be specified in that case )

Comment 8 Oded Ramraz 2012-09-10 07:53:22 UTC

*** This bug has been marked as a duplicate of bug 855749 ***

Comment 9 Oded Ramraz 2012-09-10 07:54:04 UTC
opened 2 bugs instead of this one :
https://bugzilla.redhat.com/show_bug.cgi?id=855749
https://bugzilla.redhat.com/show_bug.cgi?id=855750


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