Change in vdsm[ovirt-3.6]: vmstats: make nic_traffic private

fromani at redhat.com fromani at redhat.com
Wed Feb 24 15:28:08 UTC 2016


Hello Dan Kenigsberg,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/53991

to review the following change.

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.

X-Backport-To: 3.6
X-Rename-Only: yes
Change-Id: I7d36041886cb891962700bc8b8f899ce257198e7
Signed-off-by: Francesco Romani <fromani at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/44765
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
Continuous-Integration: Dan Kenigsberg <danken 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/91/53991/1

diff --git a/tests/vmStatsTests.py b/tests/vmStatsTests.py
index ef43524..f262f94 100644
--- a/tests/vmStatsTests.py
+++ b/tests/vmStatsTests.py
@@ -311,7 +311,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 ee3aaf2..fb8a89d 100644
--- a/tests/vmTests.py
+++ b/tests/vmTests.py
@@ -1439,7 +1439,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 14d1f56..a816ca4 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/53991
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7d36041886cb891962700bc8b8f899ce257198e7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>


More information about the vdsm-patches mailing list