Change in vdsm[master]: vmstats: make nic_traffic private

fromani at redhat.com fromani at redhat.com
Wed Aug 12 13:47:47 UTC 2015


Francesco Romani has uploaded a new change for review.

Change subject: vmstats: make nic_traffic private
......................................................................

vmstats: make nic_traffic private

The nic_traffic() was never meant to be public, so
this patch makes it private.
Only renaming.

Change-Id: I7d36041886cb891962700bc8b8f899ce257198e7
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M tests/vmStatsTests.py
M tests/vmTests.py
M vdsm/virt/vmstats.py
3 files changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/65/44765/1

diff --git a/tests/vmStatsTests.py b/tests/vmStatsTests.py
index 5db3af1..ca8b685 100644
--- a/tests/vmStatsTests.py
+++ b/tests/vmStatsTests.py
@@ -241,7 +241,7 @@
         nic = FakeNic(name='vnet0', model='virtio',
                       mac_addr='00:1a:4a:16:01:51')
 
-        stats = vmstats.nic_traffic(
+        stats = vmstats._nic_traffic(
             nic.name, nic.nicModel, nic.macAddr,
             self.bulk_stats, 0,
             self.bulk_stats, 0,
diff --git a/tests/vmTests.py b/tests/vmTests.py
index 30c7473..d9f5b36 100644
--- a/tests/vmTests.py
+++ b/tests/vmTests.py
@@ -1265,7 +1265,7 @@
         GBPS = 10 ** 9 / 8
         MAC = '52:54:00:59:F5:3F'
         pretime = utils.monotonic_time()
-        res = vmstats.nic_traffic(
+        res = vmstats._nic_traffic(
             name='vnettest', model='virtio', mac=MAC,
             start_sample={'net.0.rx.bytes': 2 ** 64 - 15 * GBPS,
                           'net.0.rx.pkts': 1,
diff --git a/vdsm/virt/vmstats.py b/vdsm/virt/vmstats.py
index cf25574..a712c6c 100644
--- a/vdsm/virt/vmstats.py
+++ b/vdsm/virt/vmstats.py
@@ -166,9 +166,9 @@
             logging.error('Failed to get VM cpu count')
 
 
-def nic_traffic(name, model, mac,
-                start_sample, start_index,
-                end_sample, end_index, interval):
+def _nic_traffic(name, model, mac,
+                 start_sample, start_index,
+                 end_sample, end_index, interval):
     ifSpeed = [100, 1000][model in ('e1000', 'virtio')]
 
     ifStats = {'macAddr': mac,
@@ -228,7 +228,7 @@
         if nic.name not in first_indexes or nic.name not in last_indexes:
             continue
 
-        stats['network'][nic.name] = nic_traffic(
+        stats['network'][nic.name] = _nic_traffic(
             nic.name, nic.nicModel, nic.macAddr,
             first_sample, first_indexes[nic.name],
             last_sample, last_indexes[nic.name],


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7d36041886cb891962700bc8b8f899ce257198e7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>


More information about the vdsm-patches mailing list