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 855724 - OVIRT35 - [RFE] ovirt-engine-restapi : Statistic values representation issues
Summary: OVIRT35 - [RFE] ovirt-engine-restapi : Statistic values representation issues
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-sdk
Version: 3.3
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: m1
: 3.5.0
Assignee: Juan Hernández
QA Contact: Oded Ramraz
URL:
Whiteboard: infra
Depends On: 1115303
Blocks: 1114551
TreeView+ depends on / blocked
 
Reported: 2012-09-10 06:20 UTC by Oded Ramraz
Modified: 2016-02-10 19:31 UTC (History)
12 users (show)

Fixed In Version: ovirt-engine-cli-3.5.0.0-1
Doc Type: Enhancement
Doc Text:
Clone Of:
: 1114551 (view as bug list)
Environment:
Last Closed: 2014-10-17 12:28:51 UTC
oVirt Team: Infra


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
oVirt gerrit 26864 master MERGED cli: Don't write integer statistics as float Never

Description Oded Ramraz 2012-09-10 06:20:28 UTC
Description of problem:

We need to update some of the statistic values to look like integers instead of floats. 

Example:

values-type       : INTEGER
values-value-datum: 33658241024.0


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


How reproducible:


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


Expected results:


Additional info:


[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

Comment 2 Juan Hernández 2014-01-17 13:39:41 UTC
The RESTAPI returns the values of these statistics correctly, as integers, it is the Python SDK that converts this to float. The CLI then renders the float with the default rendering format in Python.

Comment 3 Michael Pasternak 2014-04-17 08:00:03 UTC
(In reply to Juan Hernández from comment #2)
> The RESTAPI returns the values of these statistics correctly, as integers,
> it is the Python SDK that converts this to float. The CLI then renders the
> float with the default rendering format in Python.

the thing is that in rest-api schema datum defined as 'xs:decimal' and python
converts it to 'float' (to get maximum precision),

if fix will be in the python-sdk, it should be for datum only and 'generic' by casting statistics.value-datum to type defined in statistics.values-type

Comment 4 Sandro Bonazzola 2014-10-17 12:28:51 UTC
oVirt 3.5 has been released and should include the fix for this issue.


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