Fix the meter type for LB Bytes

This fixes the type on bytes in/out to cumulative.
Eventually when connections are fixed in LBaaS side,
those would be cumulative too. Also update the
measurement docs to reflect the newest changes.

Closes-Bug: 1328573

Change-Id: Iab221829702ab36a844d0ae65c6a3312a311a92b
This commit is contained in:
Pradeep Kilambi 2014-06-10 07:51:44 -07:00
parent 97748958b6
commit 1cf7101637
3 changed files with 25 additions and 20 deletions

View File

@ -308,7 +308,7 @@ class LBBytesInPollster(_LBStatsPollster):
return make_sample_from_pool(
pool,
name='network.services.lb.incoming.bytes',
type=sample.TYPE_GAUGE,
type=sample.TYPE_CUMULATIVE,
unit='B',
volume=data.bytes_in,
)
@ -323,7 +323,7 @@ class LBBytesOutPollster(_LBStatsPollster):
return make_sample_from_pool(
pool,
name='network.services.lb.outgoing.bytes',
type=sample.TYPE_GAUGE,
type=sample.TYPE_CUMULATIVE,
unit='B',
volume=data.bytes_out,
)

View File

@ -367,7 +367,8 @@ class TestLBStatsPollster(_BaseTestLBPollster):
}
@mock.patch('ceilometer.pipeline.setup_pipeline', mock.MagicMock())
def _check_get_samples(self, factory, sample_name, expected_volume):
def _check_get_samples(self, factory, sample_name, expected_volume,
expected_type):
pollster = factory()
cache = {}
@ -380,20 +381,24 @@ class TestLBStatsPollster(_BaseTestLBPollster):
match = [s for s in samples if s.name == sample_name]
self.assertEqual(1, len(match), 'missing counter %s' % sample_name)
self.assertEqual(expected_volume, match[0].volume)
self.assertEqual('gauge', match[0].type)
self.assertEqual(expected_type, match[0].type)
def test_lb_total_connections(self):
self._check_get_samples(lbaas.LBTotalConnectionsPollster,
'network.services.lb.total.connections', 4L)
'network.services.lb.total.connections',
4L, 'gauge')
def test_lb_active_connections(self):
self._check_get_samples(lbaas.LBActiveConnectionsPollster,
'network.services.lb.active.connections', 2L)
'network.services.lb.active.connections',
2L, 'gauge')
def test_lb_incoming_bytes(self):
self._check_get_samples(lbaas.LBBytesInPollster,
'network.services.lb.incoming.bytes', 1L)
'network.services.lb.incoming.bytes',
1L, 'cumulative')
def test_lb_outgoing_bytes(self):
self._check_get_samples(lbaas.LBBytesOutPollster,
'network.services.lb.outgoing.bytes', 3L)
'network.services.lb.outgoing.bytes',
3L, 'cumulative')

View File

@ -268,18 +268,18 @@ switch.flow.bytes Cumulative B switch ID pollster Rece
LoadBalancer as a Service (LBaaS)
=================================
======================================= ======= ========== ========== ========= ==============================
Meter Type Unit Resource Origin Note
======================================= ======= ========== ========== ========= ==============================
network.services.lb.pool Gauge pool pool ID pollster Existence of a LB Pool
network.services.lb.vip Gauge vip vip ID pollster Existence of a LB Vip
network.services.lb.member Gauge member member ID pollster Existence of a LB Member
network.services.lb.health_monitor Gauge monitor monitor ID pollster Existence of a LB Health Probe
network.services.lb.total_connections Delta connection pool ID pollster Total connections on a LB
network.services.lb.active_connections Delta connection pool ID pollster Active connections on a LB
network.services.lb.incoming.bytes Delta B pool ID pollster Number of incoming Bytes
network.services.lb.outgoing.bytes Delta B pool ID pollster Number of outgoing Bytes
======================================= ======= ========== ========== ========= ==============================
======================================= ========== ========== ========== ========= ==============================
Meter Type Unit Resource Origin Note
======================================= ========== ========== ========== ========= ==============================
network.services.lb.pool Gauge pool pool ID pollster Existence of a LB Pool
network.services.lb.vip Gauge vip vip ID pollster Existence of a LB Vip
network.services.lb.member Gauge member member ID pollster Existence of a LB Member
network.services.lb.health_monitor Gauge monitor monitor ID pollster Existence of a LB Health Probe
network.services.lb.total_connections Delta connection pool ID pollster Total connections on a LB
network.services.lb.active_connections Delta connection pool ID pollster Active connections on a LB
network.services.lb.incoming.bytes Cumulative B pool ID pollster Number of incoming Bytes
network.services.lb.outgoing.bytes Cumulative B pool ID pollster Number of outgoing Bytes
======================================= ========== ========== ========== ========= ==============================
Dynamically retrieving the Meters via ceilometer client