Francesco Romani has uploaded a new change for review. Change subject: vmstats: rename 'nic' function ......................................................................
vmstats: rename 'nic' function The vmstats module exports a 'nic' function, which produces the stats per-nic, in the format Engine expects. The problem here is that 'nic' is a too nice name, so there are other legitimate uses for it in other flows. To reduce the possibility of name clash, we just rename the function to the little less nice but little more revealing 'nic_traffic'. This is also a little lie because 'nic_traffic' adds fields which aren't strictly related to traffic proper. Future patch will clean this further and remove the little lie. Rename only. Change-Id: I4b9290843c9dc7adc9709a66a0bb97238437bd37 Signed-off-by: Francesco Romani <from...@redhat.com> --- M tests/vmTests.py M vdsm/virt/vmstats.py 2 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/94/43694/1 diff --git a/tests/vmTests.py b/tests/vmTests.py index c6bd8d0..ae31c09 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( + res = vmstats.nic_traffic( name='vnettest', model='virtio', mac=MAC, start_sample={'rx.bytes': 2 ** 64 - 15 * GBPS, 'rx.pkts': 1, diff --git a/vdsm/virt/vmstats.py b/vdsm/virt/vmstats.py index b9caeac..5416f94 100644 --- a/vdsm/virt/vmstats.py +++ b/vdsm/virt/vmstats.py @@ -136,7 +136,7 @@ logging.error('Failed to get VM cpu count') -def nic(name, model, mac, start_sample, end_sample, interval): +def nic_traffic(name, model, mac, start_sample, end_sample, interval): ifSpeed = [100, 1000][model in ('e1000', 'virtio')] ifStats = {'macAddr': mac, @@ -185,7 +185,7 @@ # may happen if nic is a new hot-plugged one if not first_nic or not last_nic: continue - stats['network'][nic.name] = nic( + stats['network'][nic.name] = nic_traffic( nic.name, nic.nicModel, nic.macAddr, first_nic, last_nic, interval) -- To view, visit https://gerrit.ovirt.org/43694 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4b9290843c9dc7adc9709a66a0bb97238437bd37 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani <from...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches