Eliminated processing_meta from hourly metrics.
Change-Id: Ibcb00cae12d87e93546bddf14a796662425f7167
This commit is contained in:
parent
0365bfa5bb
commit
eff0e74c50
|
@ -87,10 +87,6 @@ class InsertComponent(Component):
|
|||
"lastrecord_timestamp_string":
|
||||
instance_usage_dict.get(
|
||||
"lastrecord_timestamp_string",
|
||||
Component.DEFAULT_UNAVAILABLE_VALUE),
|
||||
"processing_meta":
|
||||
instance_usage_dict.get(
|
||||
"processing_meta",
|
||||
Component.DEFAULT_UNAVAILABLE_VALUE)}
|
||||
|
||||
metric_part = {"name": instance_usage_dict.get(
|
||||
|
@ -112,11 +108,6 @@ class InsertComponent(Component):
|
|||
"""write data to kafka. extracts and formats
|
||||
metric data and write s the data to kafka
|
||||
"""
|
||||
try:
|
||||
processing_meta = row.processing_meta
|
||||
except AttributeError:
|
||||
processing_meta = {}
|
||||
|
||||
instance_usage_dict = {"tenant_id": row.tenant_id,
|
||||
"user_id": row.user_id,
|
||||
"resource_uuid": row.resource_uuid,
|
||||
|
@ -139,8 +130,7 @@ class InsertComponent(Component):
|
|||
"usage_hour": row.usage_hour,
|
||||
"usage_minute": row.usage_minute,
|
||||
"aggregation_period":
|
||||
row.aggregation_period,
|
||||
"processing_meta": processing_meta}
|
||||
row.aggregation_period}
|
||||
metric = InsertComponent._prepare_metric(instance_usage_dict,
|
||||
agg_params)
|
||||
return metric
|
||||
|
|
|
@ -1187,25 +1187,6 @@ class SparkTest(SparkContextTest):
|
|||
.get('value_meta')
|
||||
.get('lastrecord_timestamp_string'))
|
||||
|
||||
self.assertEqual('3363.4285714285716',
|
||||
diskusage_rate_agg_metric.get('metric')
|
||||
.get('value_meta')
|
||||
.get('processing_meta').get('latest_quantity'))
|
||||
self.assertEqual('2016-06-10 20:27:01',
|
||||
diskusage_rate_agg_metric.get('metric')
|
||||
.get('value_meta')
|
||||
.get('processing_meta')
|
||||
.get('latest_timestamp_string'))
|
||||
self.assertEqual('2721.0',
|
||||
diskusage_rate_agg_metric.get('metric')
|
||||
.get('value_meta')
|
||||
.get('processing_meta').get('oldest_quantity'))
|
||||
self.assertEqual('2016-06-10 20:27:01',
|
||||
diskusage_rate_agg_metric.get('metric')
|
||||
.get('value_meta')
|
||||
.get('processing_meta')
|
||||
.get('oldest_timestamp_string'))
|
||||
|
||||
# Verify nova.vm.cpu.total_allocated_agg metrics
|
||||
nova_vm_cpu_total_alloc_agg_metric = [
|
||||
value for value in metrics
|
||||
|
|
Loading…
Reference in New Issue