Piotr Kliczewski has uploaded a new change for review.

Change subject: yml: return type fixes for Host.getStats
......................................................................

yml: return type fixes for Host.getStats


Change-Id: I87eb9c45371fd1c99d5d1a6645ebf51e2ab1e439
Signed-off-by: pkliczewski <[email protected]>
---
M lib/api/vdsm-api.yml
M tests/vdsmapi_test.py
2 files changed, 166 insertions(+), 155 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/18/57618/1

diff --git a/lib/api/vdsm-api.yml b/lib/api/vdsm-api.yml
index 88d9d3b..082371a 100644
--- a/lib/api/vdsm-api.yml
+++ b/lib/api/vdsm-api.yml
@@ -511,19 +511,19 @@
         properties:
         -   description: Ratio of CPU time spent in kernel
             name: cpuSys
-            type: float
+            type: string
 
         -   description: Ratio of CPU time spent in userspace
             name: cpuUser
-            type: float
+            type: string
 
         -   description: Which numa node this cpu core belongs to
-            name: numaNodeIndex
+            name: nodeIndex
             type: uint
 
         -   description: Ratio of CPU time spent idle
             name: cpuIdle
-            type: float
+            type: string
         type: object
 
     CpuCoreStatsMap: &CpuCoreStatsMap
@@ -1555,12 +1555,12 @@
         -   description: The number of incoming packets that have
                 contained errors
             name: rxErrors
-            type: uint
+            type: string
 
         -   description: The rate of incoming packets (as a percentage
                 of speed)
             name: rxRate
-            type: float
+            type: string
 
         -   description: The network device name
             name: name
@@ -1573,31 +1573,31 @@
 
         -   description: The number of incoming bytes in total
             name: rx
-            type: uint
+            type: string
             added: '3.6'
 
         -   description: The number of outgoing packets that have
                 been dropped
             name: txDropped
-            type: uint
+            type: string
 
         -   description: The number of outgoing packets that have
                 contained errors
             name: txErrors
-            type: uint
+            type: string
 
         -   description: The rate of outgoing packets (as a percentage
                 of speed)
             name: txRate
-            type: float
+            type: string
 
         -   description: The interface speed (in Megabits/s)
             name: speed
-            type: uint
+            type: string
 
         -   description: The number of outgoing bytes in total
             name: tx
-            type: uint
+            type: string
             added: '3.6'
 
         -   description: Time stamp of the sample
@@ -1608,7 +1608,7 @@
         -   description: The number of incoming packets that have
                 been dropped
             name: rxDropped
-            type: uint
+            type: string
         type: object
 
     HostedEngineStatus: &HostedEngineStatus
@@ -1671,7 +1671,7 @@
         properties:
         -   description: The amount of free memory (in MB)
             name: memFree
-            type: uint
+            type: string
 
         -   description: The ratio of used memory
             name: memPercent
@@ -1704,7 +1704,7 @@
         properties:
         -   description: The amount of free space remaining (in MB)
             name: free
-            type: uint
+            type: string
         type: object
 
     PathStatsMap: &PathStatsMap
@@ -1726,30 +1726,36 @@
                 to run (sanlock) protected VMs
             name: acquired
             type: boolean
+
         -   description: Indicates if the returned status is an actual
                 monitoring result or initial result that means that
                 the first monitor run was not yet completed
             name: actual
             type: boolean
             added: '3.5'
+
         -   description: Elapsed time since the Storage Domain was
                 last checked
             name: lastCheck
-            type: float
+            type: string
+
         -   description: Indicates if the Storage Domain is functioning
                 properly
             name: valid
             type: boolean
+
         -   description: Storage Domain status code
             name: code
             type: int
+
         -   description: Indicates the Storage Domain version
             name: version
             type: int
+
         -   description: The amount of time it takes to read a small
                 amount of data from the storage.
             name: delay
-            type: float
+            type: string
         type: object
 
     StorageDomainVitalsMap: &StorageDomainVitalsMap
@@ -1818,7 +1824,7 @@
 
         -   description: Ratio of CPU time spent in userspace by vdsm
             name: cpuUserVdsmd
-            type: float
+            type: string
 
         -   description: The total amount of swap space (in MB)
             name: swapTotal
@@ -1827,7 +1833,7 @@
         -   description: Incoming packet rate (as a percentage of total
                 capacity)
             name: rxRate
-            type: float
+            type: string
 
         -   description: The number of VMs migrating to this host
             name: incomingVmMigrations
@@ -1836,7 +1842,7 @@
 
         -   description: The 5 minute CPU load average
             name: cpuLoad
-            type: float
+            type: string
 
         -   description: The number of memory pages KSM will scan at each
                 interval
@@ -1845,16 +1851,16 @@
 
         -   description: The percentage of memory used (not including caches)
             name: memUsed
-            type: uint
+            type: string
 
         -   description: Ratio of CPU time spent idle
             name: cpuIdle
-            type: float
+            type: string
 
         -   description: Outgoing packet rate (as a percentage of total
                 capacity)
             name: txRate
-            type: float
+            type: string
 
         -   defaultvalue: 0
             description: The host score according to the HA agent, if installed
@@ -1864,7 +1870,7 @@
 
         -   description: The number of outgoing packets dropped
             name: txDropped
-            type: uint
+            type: string
 
         -   description: Indicates if KSM is enabled or disabled
             name: ksmState
@@ -1872,12 +1878,12 @@
 
         -   description: The number of seconds that vdsm has been running
             name: elapsedTime
-            type: uint
+            type: string
 
         -   description: Indicates if there are uncommitted changes to the
                 network configuration
             name: netConfigDirty
-            type: boolean
+            type: string
 
         -   description: The number of VMs active on this host
             name: vmActive
@@ -1899,7 +1905,7 @@
 
         -   description: Ratio of CPU time spent in kernel
             name: cpuSys
-            type: float
+            type: string
 
         -   description: The current date and time according to this host
             name: dateTime
@@ -1920,11 +1926,11 @@
 
         -   description: Ratio of CPU time spent in userspace
             name: cpuUser
-            type: float
+            type: string
 
         -   description: The amount of CPU being used by the KSM thread
             name: ksmCpu
-            type: float
+            type: uint
 
         -   description: Statistics about the memory of numa nodes
             added: '3.4'
@@ -1958,10 +1964,10 @@
 
         -   description: Ratio of CPU time spent in kernel by vdsm
             name: cpuSysVdsmd
-            type: float
+            type: string
 
         -   description: The current status of the Hosted Engine HA system
-            name: haStatus
+            name: haStats
             added: '3.4'
             type: *HostedEngineStatus
 
@@ -1975,7 +1981,7 @@
         -   defaultvalue: 0
             description: The boot time of the system in seconds since epoch
             name: bootTime
-            type: uint
+            type: string
             added: '3.4'
 
         -   description: Current mode of the Transparent Huge Pages feature
@@ -1984,11 +1990,15 @@
 
         -   description: The number of incoming packets dropped
             name: rxDropped
-            type: uint
+            type: string
 
         -   description: The amount of anonymous memory in huge pages (in MB)
             name: anonHugePages
-            type: uint
+            type: string
+
+        -   description: Indicates whether ksm merge is enabled
+            name: ksmMergeAcrossNodes
+            type: boolean
         type: object
 
     VmDiskDeviceFormat: &VmDiskDeviceFormat
@@ -4372,12 +4382,12 @@
             -   description: The number of incoming packets that have
                     contained errors
                 name: rxErrors
-                type: uint
+                type: string
 
             -   description: The rate of incoming packets (as a percentage
                     of speed)
                 name: rxRate
-                type: float
+                type: string
 
             -   description: The network device name
                 name: name
@@ -4390,13 +4400,13 @@
 
             -   description: The number of incoming bytes in total
                 name: rx
-                type: uint
+                type: string
                 added: '3.6'
 
             -   description: The number of outgoing packets that have
                     been dropped
                 name: txDropped
-                type: uint
+                type: string
 
             -   description: The hardware address
                 name: macAddr
@@ -4405,20 +4415,20 @@
             -   description: The number of outgoing packets that have
                     contained errors
                 name: txErrors
-                type: uint
+                type: string
 
             -   description: The rate of outgoing packets (as a percentage
                     of speed)
                 name: txRate
-                type: float
+                type: string
 
             -   description: The interface speed (in Megabits/s)
                 name: speed
-                type: uint
+                type: string
 
             -   description: The number of outgoing bytes in total
                 name: tx
-                type: uint
+                type: string
                 added: '3.6'
 
             -   description: Time stamp of the sample
@@ -4429,7 +4439,7 @@
             -   description: The number of incoming packets that have
                     been dropped
                 name: rxDropped
-                type: uint
+                type: string
             type: object
 
     NetworkInterfaceStatsMap: &NetworkInterfaceStatsMap
diff --git a/tests/vdsmapi_test.py b/tests/vdsmapi_test.py
index 1f1393d..f2621f4 100644
--- a/tests/vdsmapi_test.py
+++ b/tests/vdsmapi_test.py
@@ -125,155 +125,156 @@
 
     @api_strict_mode()
     def test_complex_ret_type(self):
-        ret = {u"cpuStatistics": {u"1": {u"cpuUser": 1.47,
-                                         u"numaNodeIndex": 0,
-                                         u"cpuSys": 1.20,
-                                         u"cpuIdle": 97.33},
-                                  u"0": {u"cpuUser": 0.33,
-                                         u"numaNodeIndex": 0,
-                                         u"cpuSys": 0.33,
-                                         u"cpuIdle": 99.34},
-                                  u"3": {u"cpuUser": 0.47,
-                                         u"numaNodeIndex": 0,
-                                         u"cpuSys": 0.27,
-                                         u"cpuIdle": 99.26},
-                                  u"2": {u"cpuUser": 0.33,
-                                         u"numaNodeIndex": 0,
-                                         u"cpuSys": 0.27,
-                                         u"cpuIdle": 99.40},
-                                  u"5": {u"cpuUser": 0.20,
-                                         u"numaNodeIndex": 0,
-                                         u"cpuSys": 0.33,
-                                         u"cpuIdle": 99.47},
-                                  u"4": {u"cpuUser": 0.47,
-                                         u"numaNodeIndex": 0,
-                                         u"cpuSys": 0.27,
-                                         u"cpuIdle": 99.26},
-                                  u"7": {u"cpuUser": 0.60,
-                                         u"numaNodeIndex": 0,
-                                         u"cpuSys": 0.40,
-                                         u"cpuIdle": 99.00},
-                                  u"6": {u"cpuUser": 0.47,
-                                         u"numaNodeIndex": 0,
-                                         u"cpuSys": 0.40,
-                                         u"cpuIdle": 99.13}},
+        ret = {u"cpuStatistics": {u"1": {u"cpuUser": u"1.47",
+                                         u"nodeIndex": 0,
+                                         u"cpuSys": u"1.20",
+                                         u"cpuIdle": u"97.33"},
+                                  u"0": {u"cpuUser": u"0.33",
+                                         u"nodeIndex": 0,
+                                         u"cpuSys": u"0.33",
+                                         u"cpuIdle": u"99.34"},
+                                  u"3": {u"cpuUser": u"0.47",
+                                         u"nodeIndex": 0,
+                                         u"cpuSys": u"0.27",
+                                         u"cpuIdle": u"99.26"},
+                                  u"2": {u"cpuUser": u"0.33",
+                                         u"nodeIndex": 0,
+                                         u"cpuSys": u"0.27",
+                                         u"cpuIdle": u"99.40"},
+                                  u"5": {u"cpuUser": u"0.20",
+                                         u"nodeIndex": 0,
+                                         u"cpuSys": u"0.33",
+                                         u"cpuIdle": u"99.47"},
+                                  u"4": {u"cpuUser": u"0.47",
+                                         u"nodeIndex": 0,
+                                         u"cpuSys": u"0.27",
+                                         u"cpuIdle": u"99.26"},
+                                  u"7": {u"cpuUser": u"0.60",
+                                         u"nodeIndex": 0,
+                                         u"cpuSys": u"0.40",
+                                         u"cpuIdle": u"99.00"},
+                                  u"6": {u"cpuUser": u"0.47",
+                                         u"nodeIndex": 0,
+                                         u"cpuSys": u"0.40",
+                                         u"cpuIdle": u"99.13"}},
                u"numaNodeMemFree": {u"0": {u"memPercent": 15,
-                                           u"memFree": 13645}},
+                                           u"memFree": u"13645"}},
                u"memShared": 0,
                u"thpState": u"madvise",
-               u"rxRate": 0.02,
+               u"rxRate": u"0.02",
                u"vmCount": 0,
-               u"memUsed": 3,
+               u"memUsed": u"3",
                u"storageDomains": {},
                u"incomingVmMigrations": 0,
-               u"network": {u"bond0": {u"rxErrors": 0,
-                                       u"txRate": 0.0,
-                                       u"rxRate": 0.0,
-                                       u"txErrors": 0,
-                                       u"speed": 1000,
-                                       u"rxDropped": 0,
+               u"network": {u"bond0": {u"rxErrors": u"0",
+                                       u"txRate": u"0.0",
+                                       u"rxRate": u"0.0",
+                                       u"txErrors": u"0",
+                                       u"speed": u"1000",
+                                       u"rxDropped": u"0",
                                        u"name": u"bond0",
-                                       u"tx": 0,
-                                       u"txDropped": 0,
+                                       u"tx": u"0",
+                                       u"txDropped": u"0",
                                        u"sampleTime": 1456911173.218806,
-                                       u"rx": 0,
+                                       u"rx": u"0",
                                        u"state": u"down"},
-                            u"ovirtmgmt": {u"rxErrors": 0,
-                                           u"txRate": 0.0,
-                                           u"rxRate": 0.0,
-                                           u"txErrors": 0,
-                                           u"speed": 1000,
-                                           u"rxDropped": 0,
+                            u"ovirtmgmt": {u"rxErrors": u"0",
+                                           u"txRate": u"0.0",
+                                           u"rxRate": u"0.0",
+                                           u"txErrors": u"0",
+                                           u"speed": u"1000",
+                                           u"rxDropped": u"0",
                                            u"name": u"ovirtmgmt",
-                                           u"tx": 560936,
-                                           u"txDropped": 0,
+                                           u"tx": u"560936",
+                                           u"txDropped": u"0",
                                            u"sampleTime": 1456911173.21,
-                                           u"rx": 2106573,
+                                           u"rx": u"2106573",
                                            u"state": u"up"},
-                            u"lo": {u"rxErrors": 0,
-                                    u"txRate": 0.1,
-                                    u"rxRate": 0.1,
-                                    u"txErrors": 0,
-                                    u"speed": 1000,
-                                    u"rxDropped": 0,
+                            u"lo": {u"rxErrors": u"0",
+                                    u"txRate": u"0.1",
+                                    u"rxRate": u"0.1",
+                                    u"txErrors": u"0",
+                                    u"speed": u"1000",
+                                    u"rxDropped": u"0",
                                     u"name": u"lo",
-                                    u"tx": 2308049,
-                                    u"txDropped": 0,
+                                    u"tx": u"2308049",
+                                    u"txDropped": u"0",
                                     u"sampleTime": 1456911173.218806,
-                                    u"rx": 2308049,
+                                    u"rx": u"2308049",
                                     u"state": u"up"},
-                            u";vdsmdummy;": {u"rxErrors": 0,
-                                             u"txRate": 0.0,
-                                             u"rxRate": 0.0,
-                                             u"txErrors": 0,
-                                             u"speed": 1000,
-                                             u"rxDropped": 0,
+                            u";vdsmdummy;": {u"rxErrors": u"0",
+                                             u"txRate": u"0.0",
+                                             u"rxRate": u"0.0",
+                                             u"txErrors": u"0",
+                                             u"speed": u"1000",
+                                             u"rxDropped": u"0",
                                              u"name": u";vdsmdummy;",
-                                             u"tx": 0,
-                                             u"txDropped": 0,
+                                             u"tx": u"0",
+                                             u"txDropped": u"0",
                                              u"sampleTime": 145691117.2,
-                                             u"rx": 0,
+                                             u"rx": u"0",
                                              u"state": u"down"},
-                            u"em1": {u"rxErrors": 0,
-                                     u"txRate": 0.0,
-                                     u"rxRate": 0.0,
-                                     u"txErrors": 0,
-                                     u"speed": 1000,
-                                     u"rxDropped": 0,
+                            u"em1": {u"rxErrors": u"0",
+                                     u"txRate": u"0.0",
+                                     u"rxRate": u"0.0",
+                                     u"txErrors": u"0",
+                                     u"speed": u"1000",
+                                     u"rxDropped": u"0",
                                      u"name": u"em1",
-                                     u"tx": 580586,
-                                     u"txDropped": 0,
+                                     u"tx": u"580586",
+                                     u"txDropped": u"0",
                                      u"sampleTime": 1456911173.218806,
-                                     u"rx": 2310757,
+                                     u"rx": u"2310757",
                                      u"state": u"up"},
-                            u"wlp1s2": {u"rxErrors": 0,
-                                        u"txRate": 0.0,
-                                        u"rxRate": 0.0,
-                                        u"txErrors": 0,
-                                        u"speed": 1000,
-                                        u"rxDropped": 0,
+                            u"wlp1s2": {u"rxErrors": u"0",
+                                        u"txRate": u"0.0",
+                                        u"rxRate": u"0.0",
+                                        u"txErrors": u"0",
+                                        u"speed": u"1000",
+                                        u"rxDropped": u"0",
                                         u"name": u"wlp1s2",
-                                        u"tx": 0,
-                                        u"txDropped": 0,
+                                        u"tx": u"0",
+                                        u"txDropped": u"0",
                                         u"sampleTime": 1456911173.21880,
-                                        u"rx": 0,
+                                        u"rx": u"0",
                                         u"state": u"down"}},
-               u"txDropped": 0,
-               u"cpuUser": 0.54,
+               u"txDropped": u"0",
+               u"cpuUser": u"0.54",
                u"ksmPages": 100,
-               u"elapsedTime": 106,
-               u"cpuLoad": 0.42,
-               u"cpuSys": 0.43,
-               u"diskStats": {u"/var/log": {u"free": 10810},
-                              u"/var/log/core": {u"free": 10810},
-                              u"/var/run/vdsm/": {u"free": 7966},
-                              u"/tmp": {u"free": 7967}},
-               u"cpuUserVdsmd": 1.07,
-               u"netConfigDirty": False,
+               u"elapsedTime": u"106",
+               u"cpuLoad": u"0.42",
+               u"cpuSys": u"0.43",
+               u"diskStats": {u"/var/log": {u"free": u"10810"},
+                              u"/var/log/core": {u"free": u"10810"},
+                              u"/var/run/vdsm/": {u"free": u"7966"},
+                              u"/tmp": {u"free": u"7967"}},
+               u"cpuUserVdsmd": u"1.07",
+               u"netConfigDirty": u"False",
                u"memCommitted": 0,
                u"ksmState": False,
                u"vmMigrating": 0,
-               u"ksmCpu": 0.0,
+               u"ksmMergeAcrossNodes": True,
+               u"ksmCpu": 0,
                u"memAvailable": 15226,
-               u"txRate": 0.02,
-               u"bootTime": 1456910791,
-               u"haStatus": {u"active": False,
-                             u"configured": False,
-                             u"score": 0,
-                             u"localMaintenance": False,
-                             u"globalMaintenance": False},
+               u"txRate": u"0.02",
+               u"bootTime": u"1456910791",
+               u"haStats": {u"active": False,
+                            u"configured": False,
+                            u"score": 0,
+                            u"localMaintenance": False,
+                            u"globalMaintenance": False},
                u"momStatus": u"active",
-               u"rxDropped": 0,
+               u"rxDropped": u"0",
                u"outgoingVmMigrations": 0,
                u"swapTotal": 8007,
                u"swapFree": 8007,
                u"dateTime": u"2016-03-02T09:32:54 GMT",
-               u"anonHugePages": 0,
+               u"anonHugePages": u"0",
                u"memFree": 15482,
-               u"cpuIdle": 99.03,
+               u"cpuIdle": u"99.03",
                u"vmActive": 0,
                u"v2vJobs": {},
-               u"cpuSysVdsmd": 0.53}
+               u"cpuSysVdsmd": u"0.53"}
 
         _schema.schema().verify_retval('Host', 'getStats', ret)
 


-- 
To view, visit https://gerrit.ovirt.org/57618
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I87eb9c45371fd1c99d5d1a6645ebf51e2ab1e439
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to