fix the bug that gnocchi dispatcher can't process single sample
When we use UDP to publish samples to Ceilometer-collector, it always come one by one. So we have to check whether the gnocchi dispatcher receive a single sample or a list. Change-Id: Idb19c8b94681b827fdfcef9c0bbbf3b85688b23c Closes-Bug:#1523124
This commit is contained in:
parent
c3bacea44f
commit
cb90fbabf7
|
@ -235,6 +235,9 @@ class GnocchiDispatcher(dispatcher.MeterDispatcherBase):
|
|||
return rd
|
||||
|
||||
def record_metering_data(self, data):
|
||||
# We may have receive only one counter on the wire
|
||||
if not isinstance(data, list):
|
||||
data = [data]
|
||||
# NOTE(sileht): skip sample generated by gnocchi itself
|
||||
data = [s for s in data if not self._is_gnocchi_activity(s)]
|
||||
|
||||
|
|
Loading…
Reference in New Issue