Marcin Mirecki has uploaded a new change for review.

Change subject: vdsm: removing txRate and rxRate from code
......................................................................

vdsm: removing txRate and rxRate from code

Vdsm should no longer send rxRate and txRate to the engine.

Change-Id: Id6466de88f0228ac3496b4642d34f5eb7b281afa
Signed-off-by: mirecki <[email protected]>
---
M lib/api/vdsm-api.yml
M lib/vdsm/host/stats.py
M lib/vdsm/virt/vmstats.py
M tests/hoststatsTests.py
M tests/vdsmapi_test.py
M tests/vmStatsTests.py
M tests/vmTests.py
M vdsm_hooks/fakevmstats/after_get_all_vm_stats.py
8 files changed, 0 insertions(+), 80 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/44/59544/1

diff --git a/lib/api/vdsm-api.yml b/lib/api/vdsm-api.yml
index b537e8e..0b8d27a 100644
--- a/lib/api/vdsm-api.yml
+++ b/lib/api/vdsm-api.yml
@@ -1591,12 +1591,6 @@
             type: string
             datatype: uint
 
-        -   description: The rate of incoming packets (as a percentage
-                of speed)
-            name: rxRate
-            type: string
-            datatype: float
-
         -   description: The network device name
             name: name
             type: string
@@ -1623,12 +1617,6 @@
             name: txErrors
             type: string
             datatype: uint
-
-        -   description: The rate of outgoing packets (as a percentage
-                of speed)
-            name: txRate
-            type: string
-            datatype: float
 
         -   description: The interface speed (in Megabits/s)
             name: speed
@@ -1877,12 +1865,6 @@
             name: swapTotal
             type: int
 
-        -   description: Incoming packet rate (as a percentage of total
-                capacity)
-            name: rxRate
-            type: string
-            datatype: float
-
         -   description: The number of VMs migrating to this host
             name: incomingVmMigrations
             type: uint
@@ -1905,12 +1887,6 @@
 
         -   description: Ratio of CPU time spent idle
             name: cpuIdle
-            type: string
-            datatype: float
-
-        -   description: Outgoing packet rate (as a percentage of total
-                capacity)
-            name: txRate
             type: string
             datatype: float
 
@@ -4466,12 +4442,6 @@
                 type: string
                 datatype: uint
 
-            -   description: The rate of incoming packets (as a percentage
-                    of speed)
-                name: rxRate
-                type: string
-                datatype: float
-
             -   description: The network device name
                 name: name
                 type: string
@@ -4502,12 +4472,6 @@
                 name: txErrors
                 type: string
                 datatype: uint
-
-            -   description: The rate of outgoing packets (as a percentage
-                    of speed)
-                name: txRate
-                type: string
-                datatype: float
 
             -   description: The interface speed (in Megabits/s)
                 name: speed
diff --git a/lib/vdsm/host/stats.py b/lib/vdsm/host/stats.py
index 23ce688..61bd5ab 100644
--- a/lib/vdsm/host/stats.py
+++ b/lib/vdsm/host/stats.py
@@ -158,12 +158,6 @@
             last_sample.interfaces[ifid].tx -
             first_sample.interfaces[ifid].tx
             ) % NETSTATS_BOUND
-        rxRate = 100.0 * thisRx / interval / ifrate / Mbps2Bps
-        txRate = 100.0 * thisTx / interval / ifrate / Mbps2Bps
-        if txRate > 100 or rxRate > 100:
-            txRate = min(txRate, 100.0)
-            rxRate = min(rxRate, 100.0)
-            logging.debug('Rate above 100%%.')
         iface = last_sample.interfaces[ifid]
         stats['network'][ifid] = {
             'name': ifid, 'speed': str(ifrate),
@@ -172,8 +166,6 @@
             'rxErrors': str(iface.rxErrors),
             'txErrors': str(iface.txErrors),
             'state': iface.operstate,
-            'rxRate': '%.1f' % rxRate,
-            'txRate': '%.1f' % txRate,
             'rx': str(iface.rx),
             'tx': str(iface.tx),
             'sampleTime': last_sample.timestamp,
@@ -185,12 +177,6 @@
         total_rate += ifrate
 
     total_bytes_per_sec = (total_rate or 1000) * (10 ** 6) / 8
-    stats['rxRate'] = 100.0 * rx / interval / total_bytes_per_sec
-    stats['txRate'] = 100.0 * tx / interval / total_bytes_per_sec
-    if stats['txRate'] > 100 or stats['rxRate'] > 100:
-        stats['txRate'] = min(stats['txRate'], 100.0)
-        stats['rxRate'] = min(stats['rxRate'], 100.0)
-        logging.debug(stats)
     stats['rxDropped'] = rxDropped
     stats['txDropped'] = txDropped
 
@@ -234,8 +220,6 @@
         'cpuUser': 0.0,
         'cpuSys': 0.0,
         'cpuIdle': 100.0,
-        'rxRate': 0.0,  # REQUIRED_FOR: engine < 3.6
-        'txRate': 0.0,  # REQUIRED_FOR: engine < 3.6
         'cpuSysVdsmd': 0.0,
         'cpuUserVdsmd': 0.0,
         'elapsedTime': _elapsed_time(),
diff --git a/lib/vdsm/virt/vmstats.py b/lib/vdsm/virt/vmstats.py
index 177e2a9..d21b3fd 100644
--- a/lib/vdsm/virt/vmstats.py
+++ b/lib/vdsm/virt/vmstats.py
@@ -251,9 +251,6 @@
                        (tx_delta % 2 ** 32) /
                        interval / if_speed / _MBPS_TO_BPS)
 
-        if_stats['rxRate'] = '%.1f' % if_rx_bytes
-        if_stats['txRate'] = '%.1f' % if_tx_bytes
-
     if_stats['sampleTime'] = monotonic_time()
 
     return if_stats
diff --git a/tests/hoststatsTests.py b/tests/hoststatsTests.py
index e40445f..47932f9 100644
--- a/tests/hoststatsTests.py
+++ b/tests/hoststatsTests.py
@@ -174,8 +174,6 @@
             'cpuSysVdsmd': 0.0,
             'cpuUser': 0.0,
             'cpuUserVdsmd': 0.0,
-            'rxRate': 0.0,
-            'txRate': 0.0,
             'elapsedTime': 0,
         }
         hoststats.start(lambda: 0)
diff --git a/tests/vdsmapi_test.py b/tests/vdsmapi_test.py
index 20cfb31..d91a76c 100644
--- a/tests/vdsmapi_test.py
+++ b/tests/vdsmapi_test.py
@@ -161,14 +161,11 @@
                                            u"memFree": u"13645"}},
                u"memShared": 0,
                u"thpState": u"madvise",
-               u"rxRate": u"0.02",
                u"vmCount": 0,
                u"memUsed": u"3",
                u"storageDomains": {},
                u"incomingVmMigrations": 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",
@@ -179,8 +176,6 @@
                                        u"rx": u"0",
                                        u"state": u"down"},
                             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",
@@ -191,8 +186,6 @@
                                            u"rx": u"2106573",
                                            u"state": u"up"},
                             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",
@@ -203,8 +196,6 @@
                                     u"rx": u"2308049",
                                     u"state": u"up"},
                             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",
@@ -215,8 +206,6 @@
                                              u"rx": u"0",
                                              u"state": u"down"},
                             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",
@@ -227,8 +216,6 @@
                                      u"rx": u"2310757",
                                      u"state": u"up"},
                             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",
@@ -256,7 +243,6 @@
                u"ksmMergeAcrossNodes": True,
                u"ksmCpu": 0,
                u"memAvailable": 15226,
-               u"txRate": u"0.02",
                u"bootTime": u"1456910791",
                u"haStats": {u"active": False,
                             u"configured": False,
@@ -329,10 +315,8 @@
                                        'rxDropped': '1572',
                                        'tx': '0',
                                        'rxErrors': '0',
-                                       'txRate': '0.0',
                                        'txDropped': '0',
                                        'rx': '90',
-                                       'rxRate': '0.0',
                                        'txErrors': '0',
                                        'state': 'unknown',
                                        'sampleTime': 4319358.22,
@@ -404,10 +388,8 @@
                                        'rxDropped': '0',
                                        'tx': '7478',
                                        'rxErrors': '0',
-                                       'txRate': '0.0',
                                        'txDropped': '0',
                                        'rx': '331023',
-                                       'rxRate': '0.0',
                                        'txErrors': '0',
                                        'state': 'unknown',
                                        'sampleTime': 4319358.22,
diff --git a/tests/vmStatsTests.py b/tests/vmStatsTests.py
index 7c385ba..9827c4e 100644
--- a/tests/vmStatsTests.py
+++ b/tests/vmStatsTests.py
@@ -306,8 +306,6 @@
         'rxDropped',
         'txErrors',
         'txDropped',
-        'rxRate',
-        'txRate',
         'rx',
         'tx',
         'sampleTime',
diff --git a/tests/vmTests.py b/tests/vmTests.py
index 6d38f46..befabf6 100644
--- a/tests/vmTests.py
+++ b/tests/vmTests.py
@@ -1382,7 +1382,6 @@
             'txErrors': '11', 'txDropped': '12',
             'macAddr': MAC, 'name': 'vnettest',
             'speed': '1000', 'state': 'unknown',
-            'rxRate': '100.0', 'txRate': '33.3',
             'rx': '0', 'tx': '625000000',
         })
 
diff --git a/vdsm_hooks/fakevmstats/after_get_all_vm_stats.py 
b/vdsm_hooks/fakevmstats/after_get_all_vm_stats.py
index 9f2002b..1f27b7e 100644
--- a/vdsm_hooks/fakevmstats/after_get_all_vm_stats.py
+++ b/vdsm_hooks/fakevmstats/after_get_all_vm_stats.py
@@ -131,10 +131,8 @@
 
     # Network:
     for net in stats['network'].values():
-        net['rxRate'] = '%.1f' % (random.uniform(0, 100))
         net['rxDropped'] = str(random.randint(0, 2*31))
         net['rxErrors'] = str(random.randint(0, 2*31))
-        net['txRate'] = '%.1f' % (random.uniform(0, 100))
         net['txDropped'] = str(random.randint(0, 2*31))
         net['txErrors'] = str(random.randint(0, 2*31))
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id6466de88f0228ac3496b4642d34f5eb7b281afa
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Marcin Mirecki <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/admin/lists/[email protected]

Reply via email to