Fix network.bw.* qty matching the unit by gnocchi collector
network.bw.* unit is MB, but actually is B. So make the qty matching the unit to MB, when collector is gnocchi. Change-Id: I44ee4eb9f1b3dc0d7d5f90a86b8c574a085e29e0 Closes-Bug: #1620199
This commit is contained in:
@@ -261,7 +261,7 @@ class CeilometerCollector(collector.BaseCollector):
|
||||
tap)
|
||||
tap = self._cacher.get_resource_detail('network.tap',
|
||||
tap_id)
|
||||
tap_bw_mb = tap_stat.max / 1048576.0
|
||||
tap_bw_mb = tap_stat.max / 1000000.0
|
||||
bw_data.append(self.t_cloudkitty.format_item(tap,
|
||||
'MB',
|
||||
tap_bw_mb))
|
||||
|
||||
@@ -273,6 +273,8 @@ class GnocchiCollector(collector.BaseCollector):
|
||||
start,
|
||||
end)
|
||||
resource_data.pop('metrics', None)
|
||||
if resource_data.get('type') == 'instance_network_interface':
|
||||
resource_data[qty] = resource_data[qty] / 1000000.0
|
||||
data = self.t_cloudkitty.format_item(
|
||||
resource_data,
|
||||
unit,
|
||||
|
||||
Reference in New Issue
Block a user