From d7c2144a9ab0b0bc5d35aa6a24f01b9fcfd90ece Mon Sep 17 00:00:00 2001 From: liuqing Date: Thu, 5 Jun 2014 17:54:42 +0800 Subject: [PATCH] Use TYPE_GAUGE rather than TYPE_CUMULATIVE For hardware network bandwidth metering, it uses TYPE_CUMULATIVE, but the oid "1.3.6.1.2.1.2.2.1.5"(in file ceilometer/hardware/inspector/snmp.py) it walks in net-snmp.org is representing ifSpeed and the type is GAUGE. Cumulative definition: Increasing over time, but when i run `ceilometer sample-list --meter hardware.network.bandwidth.bytes` the output is not increasing over time. reference: http://docs.openstack.org/developer/ceilometer/measurements.html http://www.net-snmp.org/docs/mibs/interfaces.html Change-Id: Ic8a8280695c25db103fe4e4592fe00622728655d Closes-Bug: #1326723 --- ceilometer/hardware/pollsters/net.py | 2 +- ceilometer/tests/hardware/pollsters/test_net.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ceilometer/hardware/pollsters/net.py b/ceilometer/hardware/pollsters/net.py index 516185124..525998ffd 100644 --- a/ceilometer/hardware/pollsters/net.py +++ b/ceilometer/hardware/pollsters/net.py @@ -37,7 +37,7 @@ class BandwidthBytesPollster(_Base): (nic, info) = c_data return util.make_sample_from_host(host, name='network.bandwidth.bytes', - type=sample.TYPE_CUMULATIVE, + type=sample.TYPE_GAUGE, unit='B', volume=info.bandwidth, res_metadata=nic, diff --git a/ceilometer/tests/hardware/pollsters/test_net.py b/ceilometer/tests/hardware/pollsters/test_net.py index 1928fc68a..5492f965b 100644 --- a/ceilometer/tests/hardware/pollsters/test_net.py +++ b/ceilometer/tests/hardware/pollsters/test_net.py @@ -25,7 +25,7 @@ class TestNetPollsters(base.TestPollsterBase): def test_bandwidth(self): self._check_get_samples(net.BandwidthBytesPollster, 'hardware.network.bandwidth.bytes', - 1000, sample.TYPE_CUMULATIVE) + 1000, sample.TYPE_GAUGE) def test_incoming(self): self._check_get_samples(net.IncomingBytesPollster,