Changed network bandwidth from B to MB

Change-Id: I97fcfe6f0f5a9a7a7859058eae93b926579f3328
This commit is contained in:
Stéphane Albert 2015-05-13 23:29:19 +02:00
parent f7e9102dcb
commit 9791135939
2 changed files with 75 additions and 74 deletions

View File

@ -273,9 +273,10 @@ class CeilometerCollector(collector.BaseCollector):
tap)
tap = self._cacher.get_resource_detail('network.tap',
tap_id)
tap_bw_mb = tap_stat.max / 1048576.0
bw_data.append(self.t_cloudkitty.format_item(tap,
'B',
tap_stat.max))
'MB',
tap_bw_mb))
ck_res_name = 'network.bw.{}'.format(direction)
if not bw_data:
raise collector.NoDataCollected(self.collector_name,

View File

@ -108,8 +108,8 @@ NETWORK_BW_OUT = {
"type": "network.bw.out",
"desc": {},
"vol": {
"qty": 4546.0,
"unit": "B"}}
"qty": 50.0,
"unit": "MB"}}
NETWORK_BW_RESOURCE = {
'instance_id': 'eef9673d-5d24-43fd-89f5-2929acc7e193',
@ -411,88 +411,88 @@ class VolumeGenerator(BaseGenerator):
class NetBWVolMapper(VolumeVariationMapper):
var_map = {
'mon': {
'default': 1073741824,
12: 2147483648,
13: 3221225472,
14: 2147483648,
18: 2147483648,
19: 3221225472,
20: 4294967296,
21: 4294967296,
22: 3221225472,
23: 2147483648,
'default': 1024,
12: 2048,
13: 3072,
14: 2048,
18: 2048,
19: 3072,
20: 4096,
21: 4096,
22: 3072,
23: 2048,
},
'tue': {
'default': 1073741824,
12: 2147483648,
13: 3221225472,
14: 2147483648,
18: 2147483648,
19: 3221225472,
20: 4294967296,
21: 4294967296,
22: 3221225472,
23: 2147483648,
'default': 1024,
12: 2048,
13: 3072,
14: 2048,
18: 2048,
19: 3072,
20: 4096,
21: 4096,
22: 3072,
23: 2048,
},
'wed': {
'default': 1073741824,
12: 2147483648,
13: 3221225472,
14: 2147483648,
18: 2147483648,
19: 3221225472,
20: 4294967296,
21: 4294967296,
22: 3221225472,
23: 2147483648,
'default': 1024,
12: 2048,
13: 3072,
14: 2048,
18: 2048,
19: 3072,
20: 4096,
21: 4096,
22: 3072,
23: 2048,
},
'thu': {
'default': 1073741824,
12: 2147483648,
13: 3221225472,
14: 2147483648,
18: 2147483648,
19: 3221225472,
20: 4294967296,
21: 4294967296,
22: 3221225472,
23: 2147483648,
'default': 1024,
12: 2048,
13: 3072,
14: 2048,
18: 2048,
19: 3072,
20: 4096,
21: 4096,
22: 3072,
23: 2048,
},
'fri': {
'default': 1073741824,
12: 2147483648,
13: 3221225472,
14: 2147483648,
18: 2147483648,
19: 3221225472,
20: 4294967296,
21: 4294967296,
22: 3221225472,
23: 2147483648,
'default': 1024,
12: 2048,
13: 3072,
14: 2048,
18: 2048,
19: 3072,
20: 4096,
21: 4096,
22: 3072,
23: 2048,
},
'sat': {
'default': 2147483648,
12: 3221225472,
13: 4294967296,
14: 3221225472,
18: 3221225472,
19: 4294967296,
20: 4294967296,
21: 4294967296,
22: 4294967296,
23: 3221225472,
'default': 2048,
12: 3072,
13: 4096,
14: 3072,
18: 3072,
19: 4096,
20: 4096,
21: 4096,
22: 4096,
23: 3072,
},
'sun': {
'default': 2147483648,
12: 3221225472,
13: 4294967296,
14: 3221225472,
18: 3221225472,
19: 4294967296,
20: 4294967296,
21: 4294967296,
22: 4294967296,
23: 3221225472,
'default': 2048,
12: 3072,
13: 4096,
14: 3072,
18: 3072,
19: 4096,
20: 4096,
21: 4096,
22: 4096,
23: 3072,
}}