Added aggregation for cpu.total_logical_cores and
cpu.utilized_logical_cores by host. Change-Id: Ib6c6def9f882ad0fb010494a5561225c37882a07
This commit is contained in:
parent
05c36ab8e5
commit
11e8bac2cf
|
@ -5,7 +5,7 @@
|
|||
{"event_processing_params":{"set_default_zone_to":"1","set_default_geolocation_to":"1","set_default_region_to":"W"},"event_type":"disk.total_used_space_mb","metric_id_list":["disk_usable_all"],"required_raw_fields_list":["creation_time"],"service_id":"host_metrics"}
|
||||
{"event_processing_params":{"set_default_zone_to":"1","set_default_geolocation_to":"1","set_default_region_to":"W"},"event_type":"nova.vm.disk.total_allocated_gb","metric_id_list":["nova_disk_total_allocated_gb_all"],"required_raw_fields_list":["creation_time"],"service_id":"host_metrics"}
|
||||
{"event_processing_params":{"set_default_zone_to":"1","set_default_geolocation_to":"1","set_default_region_to":"W"},"event_type":"disk.allocation","metric_id_list":["disk_allocation_all","disk_allocation_project"],"required_raw_fields_list":["creation_time","tenantId"],"service_id":"host_metrics"}
|
||||
{"event_processing_params":{"set_default_zone_to":"1","set_default_geolocation_to":"1","set_default_region_to":"W"},"event_type":"cpu.total_logical_cores","metric_id_list":["cpu_total_all","cpu_util_all"],"required_raw_fields_list":["creation_time"],"service_id":"host_metrics"}
|
||||
{"event_processing_params":{"set_default_zone_to":"1","set_default_geolocation_to":"1","set_default_region_to":"W"},"event_type":"cpu.idle_perc","metric_id_list":["cpu_util_all"],"required_raw_fields_list":["creation_time"],"service_id":"host_metrics"}
|
||||
{"event_processing_params":{"set_default_zone_to":"1","set_default_geolocation_to":"1","set_default_region_to":"W"},"event_type":"cpu.total_logical_cores","metric_id_list":["cpu_total_all","cpu_total_host","cpu_util_all","cpu_util_host"],"required_raw_fields_list":["creation_time"],"service_id":"host_metrics"}
|
||||
{"event_processing_params":{"set_default_zone_to":"1","set_default_geolocation_to":"1","set_default_region_to":"W"},"event_type":"cpu.idle_perc","metric_id_list":["cpu_util_all","cpu_util_host"],"required_raw_fields_list":["creation_time"],"service_id":"host_metrics"}
|
||||
{"event_processing_params":{"set_default_zone_to":"1","set_default_geolocation_to":"1","set_default_region_to":"W"},"event_type":"vcpus","metric_id_list":["vcpus_all","vcpus_project"],"required_raw_fields_list":["creation_time","project_id"],"service_id":"host_metrics"}
|
||||
{"event_processing_params":{"set_default_zone_to":"1","set_default_geolocation_to":"1","set_default_region_to":"W"},"event_type":"vm.cpu.utilization_perc","metric_id_list":["vm_cpu_util_perc_project"],"required_raw_fields_list":["creation_time","tenant_id"],"service_id":"host_metrics"}
|
||||
|
|
|
@ -8,7 +8,9 @@
|
|||
{"aggregation_params_map":{"aggregation_pipeline":{"source":"streaming","usage":"fetch_quantity","setters":["rollup_quantity","set_aggregated_metric_name","set_aggregated_period"],"insert":["prepare_data","insert_data"]},"aggregated_metric_name":"disk.allocation_agg","aggregation_period":"hourly","aggregation_group_by_list": ["host", "metric_id", "tenant_id"],"usage_fetch_operation": "avg","setter_rollup_group_by_list": [],"setter_rollup_operation": "sum","dimension_list":["aggregation_period","host","project_id"]},"metric_group":"disk_allocation_all","metric_id":"disk_allocation_all"}
|
||||
{"aggregation_params_map":{"aggregation_pipeline":{"source":"streaming","usage":"fetch_quantity","setters":["rollup_quantity","set_aggregated_metric_name","set_aggregated_period"],"insert":["prepare_data","insert_data"]},"aggregated_metric_name":"disk.allocation_agg","aggregation_period":"hourly","aggregation_group_by_list": ["host", "metric_id", "tenant_id"],"usage_fetch_operation": "avg","setter_rollup_group_by_list": ["tenant_id"],"setter_rollup_operation": "sum","dimension_list":["aggregation_period","host","project_id"]},"metric_group":"disk_allocation_project","metric_id":"disk_allocation_project"}
|
||||
{"aggregation_params_map":{"aggregation_pipeline":{"source":"streaming","usage":"fetch_quantity","setters":["rollup_quantity","set_aggregated_metric_name","set_aggregated_period"],"insert":["prepare_data","insert_data"]},"aggregated_metric_name":"cpu.total_logical_cores_agg","aggregation_period":"hourly","aggregation_group_by_list": ["host", "metric_id", "tenant_id"],"usage_fetch_operation": "avg","setter_rollup_group_by_list": [],"setter_rollup_operation": "sum","dimension_list":["aggregation_period","host","project_id"]},"metric_group":"cpu_total_all","metric_id":"cpu_total_all"}
|
||||
{"aggregation_params_map":{"aggregation_pipeline":{"source":"streaming","usage":"fetch_quantity","setters":["rollup_quantity","set_aggregated_metric_name","set_aggregated_period"],"insert":["prepare_data","insert_data"]},"aggregated_metric_name":"cpu.total_logical_cores_agg","aggregation_period":"hourly","aggregation_group_by_list": ["host", "metric_id", "tenant_id"],"usage_fetch_operation": "avg","setter_rollup_group_by_list": ["host"],"setter_rollup_operation": "sum","dimension_list":["aggregation_period","host","project_id"]},"metric_group":"cpu_total_host","metric_id":"cpu_total_host"}
|
||||
{"aggregation_params_map":{"aggregation_pipeline":{"source":"streaming","usage":"fetch_quantity_util","setters":["rollup_quantity","set_aggregated_metric_name","set_aggregated_period"],"insert":["prepare_data","insert_data"]},"aggregated_metric_name":"cpu.utilized_logical_cores_agg","aggregation_period":"hourly","aggregation_group_by_list": ["event_type", "host"],"usage_fetch_operation": "avg","usage_fetch_util_quantity_event_type": "cpu.total_logical_cores","usage_fetch_util_idle_perc_event_type": "cpu.idle_perc","setter_rollup_group_by_list": [],"setter_rollup_operation": "sum","dimension_list":["aggregation_period","host","project_id"]},"metric_group":"cpu_util_all","metric_id":"cpu_util_all"}
|
||||
{"aggregation_params_map":{"aggregation_pipeline":{"source":"streaming","usage":"fetch_quantity_util","setters":["rollup_quantity","set_aggregated_metric_name","set_aggregated_period"],"insert":["prepare_data","insert_data"]},"aggregated_metric_name":"cpu.utilized_logical_cores_agg","aggregation_period":"hourly","aggregation_group_by_list": ["event_type", "host"],"usage_fetch_operation": "avg","usage_fetch_util_quantity_event_type": "cpu.total_logical_cores","usage_fetch_util_idle_perc_event_type": "cpu.idle_perc","setter_rollup_group_by_list": ["host"],"setter_rollup_operation": "sum","dimension_list":["aggregation_period","host","project_id"]},"metric_group":"cpu_util_host","metric_id":"cpu_util_host"}
|
||||
{"aggregation_params_map":{"aggregation_pipeline":{"source":"streaming","usage":"fetch_quantity","setters":["rollup_quantity","set_aggregated_metric_name","set_aggregated_period"],"insert":["prepare_data","insert_data"]},"aggregated_metric_name":"vcpus_agg","aggregation_period":"hourly","aggregation_group_by_list": ["host", "metric_id", "tenant_id"],"usage_fetch_operation": "avg","setter_rollup_group_by_list": [],"setter_rollup_operation": "sum","dimension_list":["aggregation_period","host","project_id"]},"metric_group":"vcpus_all","metric_id":"vcpus_all"}
|
||||
{"aggregation_params_map":{"aggregation_pipeline":{"source":"streaming","usage":"fetch_quantity","setters":["rollup_quantity","set_aggregated_metric_name","set_aggregated_period"],"insert":["prepare_data","insert_data"]},"aggregated_metric_name":"vcpus_agg","aggregation_period":"hourly","aggregation_group_by_list": ["host", "metric_id", "tenant_id"],"usage_fetch_operation": "avg","setter_rollup_group_by_list": ["tenant_id"],"setter_rollup_operation": "sum","dimension_list":["aggregation_period","host","project_id"]},"metric_group":"vcpus_project","metric_id":"vcpus_project"}
|
||||
{"aggregation_params_map":{"aggregation_pipeline":{"source":"streaming","usage":"fetch_quantity","setters":["rollup_quantity","set_aggregated_metric_name","set_aggregated_period"],"insert":["prepare_data","insert_data"]},"aggregated_metric_name":"vm.cpu.utilization_perc_agg","aggregation_period":"hourly","aggregation_group_by_list": ["host", "metric_id", "tenant_id", "resource_uuid"],"usage_fetch_operation": "sum","setter_rollup_group_by_list": ["tenant_id"],"setter_rollup_operation": "sum","dimension_list":["aggregation_period","host","project_id"]},"metric_group":"vm_cpu_util_perc_project","metric_id":"vm_cpu_util_perc_project"}
|
||||
|
|
|
@ -114,7 +114,7 @@ class SparkTest(SparkContextTest):
|
|||
result = simple_count_transform(rdd_monasca_with_offsets)
|
||||
|
||||
# Verify it worked
|
||||
self.assertEqual(result, 320)
|
||||
self.assertEqual(result, 324)
|
||||
|
||||
# Call the primary method in mon_metrics_kafka
|
||||
MonMetricsKafkaProcessor.rdd_to_recordstore(
|
||||
|
@ -123,6 +123,7 @@ class SparkTest(SparkContextTest):
|
|||
# get the metrics that have been submitted to the dummy message adapter
|
||||
metrics = MessageAdapter.adapter_impl.metric_list
|
||||
|
||||
# Verify mem.total_mb_agg metrics
|
||||
total_mb_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') == 'mem.total_mb_agg'][0]
|
||||
|
@ -152,6 +153,7 @@ class SparkTest(SparkContextTest):
|
|||
total_mb_agg_metric.get('metric').get('value_meta')
|
||||
.get('lastrecord_timestamp'))
|
||||
|
||||
# Verify mem.usable_mb_agg metrics
|
||||
usable_mb_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') == 'mem.usable_mb_agg'][0]
|
||||
|
@ -183,6 +185,7 @@ class SparkTest(SparkContextTest):
|
|||
usable_mb_agg_metric.get('metric').get('value_meta')
|
||||
.get('lastrecord_timestamp'))
|
||||
|
||||
# Verify vcpus_agg metrics for all projects
|
||||
vcpus_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') ==
|
||||
|
@ -222,6 +225,8 @@ class SparkTest(SparkContextTest):
|
|||
.get('metric').get('value_meta')
|
||||
.get('lastrecord_timestamp'))
|
||||
|
||||
# Verify vcpus_agg metrics for 8647fd5030b04a799b0411cc38c4102d
|
||||
# project
|
||||
vcpus_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') ==
|
||||
|
@ -261,6 +266,8 @@ class SparkTest(SparkContextTest):
|
|||
.get('metric').get('value_meta')
|
||||
.get('lastrecord_timestamp'))
|
||||
|
||||
# Verify vcpus_agg metrics for 9647fd5030b04a799b0411cc38c4102d
|
||||
# project
|
||||
vcpus_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') ==
|
||||
|
@ -300,6 +307,7 @@ class SparkTest(SparkContextTest):
|
|||
.get('metric').get('value_meta')
|
||||
.get('lastrecord_timestamp'))
|
||||
|
||||
# Verify vm.mem.total_mb_agg metrics for all projects
|
||||
vm_mem_total_mb_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') ==
|
||||
|
@ -339,6 +347,8 @@ class SparkTest(SparkContextTest):
|
|||
.get('metric').get('value_meta')
|
||||
.get('lastrecord_timestamp'))
|
||||
|
||||
# Verify vm.mem.total_mb_agg metrics for
|
||||
# 5f681592f7084c5fbcd4e8a20a4fef15 project
|
||||
vm_mem_total_mb_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') ==
|
||||
|
@ -378,6 +388,8 @@ class SparkTest(SparkContextTest):
|
|||
.get('metric').get('value_meta')
|
||||
.get('lastrecord_timestamp'))
|
||||
|
||||
# Verify vm.mem.total_mb_agg metrics for
|
||||
# 6f681592f7084c5fbcd4e8a20a4fef15 project
|
||||
vm_mem_total_mb_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') ==
|
||||
|
@ -417,6 +429,7 @@ class SparkTest(SparkContextTest):
|
|||
.get('metric').get('value_meta')
|
||||
.get('lastrecord_timestamp'))
|
||||
|
||||
# Verify nova.vm.disk.total_allocated_gb_agg metrics
|
||||
total_allocated_disk_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') ==
|
||||
|
@ -450,6 +463,7 @@ class SparkTest(SparkContextTest):
|
|||
total_allocated_disk_agg_metric.get('metric')
|
||||
.get('value_meta').get('lastrecord_timestamp'))
|
||||
|
||||
# Verify disk.allocation_agg metrics for all projects
|
||||
disk_allocation_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') ==
|
||||
|
@ -489,6 +503,8 @@ class SparkTest(SparkContextTest):
|
|||
.get('metric').get('value_meta')
|
||||
.get('lastrecord_timestamp'))
|
||||
|
||||
# Verify disk.allocation_agg metrics for
|
||||
# 5f681592f7084c5fbcd4e8a20a4fef15 project
|
||||
disk_allocation_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') ==
|
||||
|
@ -528,6 +544,8 @@ class SparkTest(SparkContextTest):
|
|||
.get('metric').get('value_meta')
|
||||
.get('lastrecord_timestamp'))
|
||||
|
||||
# Verify disk.allocation_agg metrics for
|
||||
# 6f681592f7084c5fbcd4e8a20a4fef15 project
|
||||
disk_allocation_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') ==
|
||||
|
@ -567,6 +585,8 @@ class SparkTest(SparkContextTest):
|
|||
.get('metric').get('value_meta')
|
||||
.get('lastrecord_timestamp'))
|
||||
|
||||
# Verify vm.cpu.utilization_perc_agg metrics for
|
||||
# 817331145b804dc9a7accb6edfb0674d project
|
||||
vm_cpu_util_perc_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') ==
|
||||
|
@ -602,6 +622,8 @@ class SparkTest(SparkContextTest):
|
|||
vm_cpu_util_perc_agg_metric.get('metric')
|
||||
.get('value_meta').get('lastrecord_timestamp'))
|
||||
|
||||
# Verify vm.cpu.utilization_perc_agg metrics for
|
||||
# 5d0e49bdc4534bb4b65909228aa040da project
|
||||
vm_cpu_util_perc_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') ==
|
||||
|
@ -637,6 +659,205 @@ class SparkTest(SparkContextTest):
|
|||
vm_cpu_util_perc_agg_metric.get('metric')
|
||||
.get('value_meta').get('lastrecord_timestamp'))
|
||||
|
||||
# Verify disk.total_space_mb_agg metrics
|
||||
disk_total_space_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') ==
|
||||
'disk.total_space_mb_agg'][0]
|
||||
|
||||
self.assertTrue(disk_total_space_agg_metric is not None)
|
||||
|
||||
self.assertEqual(2574044.0,
|
||||
disk_total_space_agg_metric
|
||||
.get('metric').get('value'))
|
||||
self.assertEqual('useast',
|
||||
disk_total_space_agg_metric
|
||||
.get('meta').get('region'))
|
||||
|
||||
self.assertEqual(cfg.CONF.messaging.publish_kafka_tenant_id,
|
||||
disk_total_space_agg_metric
|
||||
.get('meta').get('tenantId'))
|
||||
self.assertEqual('all',
|
||||
disk_total_space_agg_metric
|
||||
.get('metric').get('dimensions').get('host'))
|
||||
self.assertEqual('hourly',
|
||||
disk_total_space_agg_metric
|
||||
.get('metric').get('dimensions')
|
||||
.get('aggregation_period'))
|
||||
|
||||
self.assertEqual(2.0,
|
||||
disk_total_space_agg_metric
|
||||
.get('metric').get('value_meta').get('record_count'))
|
||||
self.assertEqual('2016-06-01 21:09:21',
|
||||
disk_total_space_agg_metric
|
||||
.get('metric').get('value_meta')
|
||||
.get('firstrecord_timestamp'))
|
||||
self.assertEqual('2016-06-01 21:09:24',
|
||||
disk_total_space_agg_metric
|
||||
.get('metric').get('value_meta')
|
||||
.get('lastrecord_timestamp'))
|
||||
|
||||
# Verify disk.total_used_space_mb_agg metrics
|
||||
disk_total_used_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') ==
|
||||
'disk.total_used_space_mb_agg'][0]
|
||||
|
||||
self.assertTrue(disk_total_used_agg_metric is not None)
|
||||
|
||||
self.assertEqual(34043.0,
|
||||
disk_total_used_agg_metric
|
||||
.get('metric').get('value'))
|
||||
self.assertEqual('useast',
|
||||
disk_total_used_agg_metric
|
||||
.get('meta').get('region'))
|
||||
|
||||
self.assertEqual(cfg.CONF.messaging.publish_kafka_tenant_id,
|
||||
disk_total_used_agg_metric
|
||||
.get('meta').get('tenantId'))
|
||||
self.assertEqual('all',
|
||||
disk_total_used_agg_metric
|
||||
.get('metric').get('dimensions').get('host'))
|
||||
self.assertEqual('hourly',
|
||||
disk_total_used_agg_metric
|
||||
.get('metric').get('dimensions')
|
||||
.get('aggregation_period'))
|
||||
|
||||
self.assertEqual(2.0,
|
||||
disk_total_used_agg_metric
|
||||
.get('metric').get('value_meta').get('record_count'))
|
||||
self.assertEqual('2016-06-01 21:09:21',
|
||||
disk_total_used_agg_metric
|
||||
.get('metric').get('value_meta')
|
||||
.get('firstrecord_timestamp'))
|
||||
self.assertEqual('2016-06-01 21:09:24',
|
||||
disk_total_used_agg_metric
|
||||
.get('metric').get('value_meta')
|
||||
.get('lastrecord_timestamp'))
|
||||
|
||||
# Verify cpu.utilized_logical_cores_agg metrics for all hosts
|
||||
cpu_util_cores_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') ==
|
||||
'cpu.utilized_logical_cores_agg' and
|
||||
value.get('metric').get('dimensions').get('host') ==
|
||||
'all'][0]
|
||||
|
||||
self.assertTrue(cpu_util_cores_agg_metric is not None)
|
||||
|
||||
self.assertEqual(2.0,
|
||||
cpu_util_cores_agg_metric
|
||||
.get('metric').get('value'))
|
||||
self.assertEqual('useast',
|
||||
cpu_util_cores_agg_metric
|
||||
.get('meta').get('region'))
|
||||
|
||||
self.assertEqual(cfg.CONF.messaging.publish_kafka_tenant_id,
|
||||
cpu_util_cores_agg_metric
|
||||
.get('meta').get('tenantId'))
|
||||
self.assertEqual('all',
|
||||
cpu_util_cores_agg_metric
|
||||
.get('metric').get('dimensions')
|
||||
.get('project_id'))
|
||||
self.assertEqual('hourly',
|
||||
cpu_util_cores_agg_metric
|
||||
.get('metric').get('dimensions')
|
||||
.get('aggregation_period'))
|
||||
|
||||
self.assertEqual(13.0,
|
||||
cpu_util_cores_agg_metric
|
||||
.get('metric').get('value_meta').get('record_count'))
|
||||
self.assertEqual('2016-03-07 16:09:23',
|
||||
cpu_util_cores_agg_metric
|
||||
.get('metric').get('value_meta')
|
||||
.get('firstrecord_timestamp'))
|
||||
self.assertEqual('2016-03-07 16:10:38',
|
||||
cpu_util_cores_agg_metric
|
||||
.get('metric').get('value_meta')
|
||||
.get('lastrecord_timestamp'))
|
||||
|
||||
# Verify cpu.utilized_logical_cores_agg metrics for mini-mon host
|
||||
cpu_util_cores_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') ==
|
||||
'cpu.utilized_logical_cores_agg' and
|
||||
value.get('metric').get('dimensions').get('host') ==
|
||||
'mini-mon'][0]
|
||||
|
||||
self.assertTrue(cpu_util_cores_agg_metric is not None)
|
||||
|
||||
self.assertEqual(1.0,
|
||||
cpu_util_cores_agg_metric
|
||||
.get('metric').get('value'))
|
||||
self.assertEqual('useast',
|
||||
cpu_util_cores_agg_metric
|
||||
.get('meta').get('region'))
|
||||
|
||||
self.assertEqual(cfg.CONF.messaging.publish_kafka_tenant_id,
|
||||
cpu_util_cores_agg_metric
|
||||
.get('meta').get('tenantId'))
|
||||
self.assertEqual('all',
|
||||
cpu_util_cores_agg_metric
|
||||
.get('metric').get('dimensions')
|
||||
.get('project_id'))
|
||||
self.assertEqual('hourly',
|
||||
cpu_util_cores_agg_metric
|
||||
.get('metric').get('dimensions')
|
||||
.get('aggregation_period'))
|
||||
|
||||
self.assertEqual(6.0,
|
||||
cpu_util_cores_agg_metric
|
||||
.get('metric').get('value_meta').get('record_count'))
|
||||
self.assertEqual('2016-03-07 16:09:23',
|
||||
cpu_util_cores_agg_metric
|
||||
.get('metric').get('value_meta')
|
||||
.get('firstrecord_timestamp'))
|
||||
self.assertEqual('2016-03-07 16:10:38',
|
||||
cpu_util_cores_agg_metric
|
||||
.get('metric').get('value_meta')
|
||||
.get('lastrecord_timestamp'))
|
||||
|
||||
# Verify vm.cpu.utilization_perc_agg metrics for devstack host
|
||||
cpu_util_cores_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') ==
|
||||
'cpu.utilized_logical_cores_agg' and
|
||||
value.get('metric').get('dimensions').get('host') ==
|
||||
'devstack'][0]
|
||||
|
||||
self.assertTrue(cpu_util_cores_agg_metric is not None)
|
||||
|
||||
self.assertEqual(1.0,
|
||||
cpu_util_cores_agg_metric
|
||||
.get('metric').get('value'))
|
||||
self.assertEqual('useast',
|
||||
cpu_util_cores_agg_metric
|
||||
.get('meta').get('region'))
|
||||
|
||||
self.assertEqual(cfg.CONF.messaging.publish_kafka_tenant_id,
|
||||
cpu_util_cores_agg_metric
|
||||
.get('meta').get('tenantId'))
|
||||
self.assertEqual('all',
|
||||
cpu_util_cores_agg_metric
|
||||
.get('metric').get('dimensions')
|
||||
.get('project_id'))
|
||||
self.assertEqual('hourly',
|
||||
cpu_util_cores_agg_metric
|
||||
.get('metric').get('dimensions')
|
||||
.get('aggregation_period'))
|
||||
|
||||
self.assertEqual(7.0,
|
||||
cpu_util_cores_agg_metric
|
||||
.get('metric').get('value_meta').get('record_count'))
|
||||
self.assertEqual('2016-03-07 16:09:23',
|
||||
cpu_util_cores_agg_metric
|
||||
.get('metric').get('value_meta')
|
||||
.get('firstrecord_timestamp'))
|
||||
self.assertEqual('2016-03-07 16:10:38',
|
||||
cpu_util_cores_agg_metric
|
||||
.get('metric').get('value_meta')
|
||||
.get('lastrecord_timestamp'))
|
||||
|
||||
|
||||
def simple_count_transform(rdd):
|
||||
return rdd.count()
|
||||
|
|
|
@ -215,7 +215,6 @@
|
|||
('<message id>','{"metric":{"name":"vm.mem.total_mb","dimensions":{"component":"vm","service":"compute","hostname":"mini-mon","tenantId":"6f681592f7084c5fbcd4e8a20a4fef15"},"timestamp":1453308006000,"value":2048.0},"meta":{"tenantId":"tenantId of metric writer","region":"useast"},"creation_time":1458578365}')
|
||||
('<message id>','{"metric":{"name":"vm.mem.total_mb","dimensions":{"component":"vm","service":"compute","hostname":"mini-mon","tenantId":"6f681592f7084c5fbcd4e8a20a4fef15"},"timestamp":1453308046000,"value":9728.0},"meta":{"tenantId":"tenantId of metric writer","region":"useast"},"creation_time":1458578365}')
|
||||
('<message id>','{"metric":{"name":"cpu.wait_perc","dimensions":{"hostname":"devstack"},"timestamp":1457366959000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366963}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"hostname":"devstack"},"timestamp":1457366959000,"value":93.6},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366963}')
|
||||
('<message id>','{"metric":{"name":"apache.performance.cpu_load_perc","dimensions":{"apache_port":"80","component":"apache","service":"apache","hostname":"devstack","apache_host":"devstack"},"timestamp":1457366959000,"value":0.143361},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366963}')
|
||||
('<message id>','{"metric":{"name":"cpu.stolen_perc","dimensions":{"hostname":"devstack"},"timestamp":1457366959000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366963}')
|
||||
('<message id>','{"metric":{"name":"cpu.user_perc","dimensions":{"hostname":"devstack"},"timestamp":1457366959000,"value":3.6},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366963}')
|
||||
|
@ -224,10 +223,8 @@
|
|||
('<message id>','{"metric":{"name":"cpu.stolen_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457366963000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366966}')
|
||||
('<message id>','{"metric":{"name":"cpu.user_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457366963000,"value":8.7},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366966}')
|
||||
('<message id>','{"metric":{"name":"cpu.total_logical_cores","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457366963000,"value":4.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366966}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457366963000,"value":88.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366966}')
|
||||
('<message id>','{"metric":{"name":"cpu.wait_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457366963000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366966}')
|
||||
('<message id>','{"metric":{"name":"cpu.wait_perc","dimensions":{"hostname":"devstack"},"timestamp":1457366974000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366977}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"hostname":"devstack"},"timestamp":1457366974000,"value":93.7},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366977}')
|
||||
('<message id>','{"metric":{"name":"apache.performance.cpu_load_perc","dimensions":{"apache_port":"80","component":"apache","service":"apache","hostname":"devstack","apache_host":"devstack"},"timestamp":1457366974000,"value":0.143374},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366977}')
|
||||
('<message id>','{"metric":{"name":"cpu.stolen_perc","dimensions":{"hostname":"devstack"},"timestamp":1457366974000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366977}')
|
||||
('<message id>','{"metric":{"name":"cpu.user_perc","dimensions":{"hostname":"devstack"},"timestamp":1457366974000,"value":3.7},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366977}')
|
||||
|
@ -236,10 +233,8 @@
|
|||
('<message id>','{"metric":{"name":"cpu.stolen_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457366977000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366980}')
|
||||
('<message id>','{"metric":{"name":"cpu.user_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457366977000,"value":5.7},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366980}')
|
||||
('<message id>','{"metric":{"name":"cpu.total_logical_cores","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457366977000,"value":4.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366980}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457366977000,"value":90.7},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366980}')
|
||||
('<message id>','{"metric":{"name":"cpu.wait_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457366977000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366980}')
|
||||
('<message id>','{"metric":{"name":"cpu.wait_perc","dimensions":{"hostname":"devstack"},"timestamp":1457366989000,"value":0.1},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366991}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"hostname":"devstack"},"timestamp":1457366989000,"value":89.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366991}')
|
||||
('<message id>','{"metric":{"name":"apache.performance.cpu_load_perc","dimensions":{"apache_port":"80","component":"apache","service":"apache","hostname":"devstack","apache_host":"devstack"},"timestamp":1457366989000,"value":0.143414},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366991}')
|
||||
('<message id>','{"metric":{"name":"cpu.stolen_perc","dimensions":{"hostname":"devstack"},"timestamp":1457366989000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366991}')
|
||||
('<message id>','{"metric":{"name":"cpu.user_perc","dimensions":{"hostname":"devstack"},"timestamp":1457366989000,"value":6.5},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366991}')
|
||||
|
@ -248,10 +243,8 @@
|
|||
('<message id>','{"metric":{"name":"cpu.stolen_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457366993000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366994}')
|
||||
('<message id>','{"metric":{"name":"cpu.user_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457366993000,"value":5.4},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366994}')
|
||||
('<message id>','{"metric":{"name":"cpu.total_logical_cores","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457366993000,"value":4.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366994}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457366993000,"value":89.8},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366994}')
|
||||
('<message id>','{"metric":{"name":"cpu.wait_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457366993000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366994}')
|
||||
('<message id>','{"metric":{"name":"cpu.wait_perc","dimensions":{"hostname":"devstack"},"timestamp":1457367004000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367005}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"hostname":"devstack"},"timestamp":1457367004000,"value":93.6},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367005}')
|
||||
('<message id>','{"metric":{"name":"apache.performance.cpu_load_perc","dimensions":{"apache_port":"80","component":"apache","service":"apache","hostname":"devstack","apache_host":"devstack"},"timestamp":1457367004000,"value":0.143409},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367005}')
|
||||
('<message id>','{"metric":{"name":"cpu.stolen_perc","dimensions":{"hostname":"devstack"},"timestamp":1457367004000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367005}')
|
||||
('<message id>','{"metric":{"name":"cpu.user_perc","dimensions":{"hostname":"devstack"},"timestamp":1457367004000,"value":4.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367005}')
|
||||
|
@ -260,10 +253,8 @@
|
|||
('<message id>','{"metric":{"name":"cpu.stolen_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457367008000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367008}')
|
||||
('<message id>','{"metric":{"name":"cpu.user_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457367008000,"value":5.2},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367008}')
|
||||
('<message id>','{"metric":{"name":"cpu.total_logical_cores","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457367008000,"value":4.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367008}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457367008000,"value":91.2},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367008}')
|
||||
('<message id>','{"metric":{"name":"cpu.wait_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457367008000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367008}')
|
||||
('<message id>','{"metric":{"name":"cpu.wait_perc","dimensions":{"hostname":"devstack"},"timestamp":1457367019000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367026}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"hostname":"devstack"},"timestamp":1457367019000,"value":93.7},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367026}')
|
||||
('<message id>','{"metric":{"name":"apache.performance.cpu_load_perc","dimensions":{"apache_port":"80","component":"apache","service":"apache","hostname":"devstack","apache_host":"devstack"},"timestamp":1457367019000,"value":0.143412},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367026}')
|
||||
('<message id>','{"metric":{"name":"cpu.stolen_perc","dimensions":{"hostname":"devstack"},"timestamp":1457367019000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367026}')
|
||||
('<message id>','{"metric":{"name":"cpu.user_perc","dimensions":{"hostname":"devstack"},"timestamp":1457367019000,"value":3.8},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367026}')
|
||||
|
@ -272,10 +263,8 @@
|
|||
('<message id>','{"metric":{"name":"cpu.stolen_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457367023000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367029}')
|
||||
('<message id>','{"metric":{"name":"cpu.user_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457367023000,"value":5.5},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367029}')
|
||||
('<message id>','{"metric":{"name":"cpu.total_logical_cores","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457367023000,"value":4.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367029}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457367023000,"value":91.2},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367029}')
|
||||
('<message id>','{"metric":{"name":"cpu.wait_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457367023000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367029}')
|
||||
('<message id>','{"metric":{"name":"cpu.wait_perc","dimensions":{"hostname":"devstack"},"timestamp":1457367034000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367040}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"hostname":"devstack"},"timestamp":1457367034000,"value":92.9},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367040}')
|
||||
('<message id>','{"metric":{"name":"apache.performance.cpu_load_perc","dimensions":{"apache_port":"80","component":"apache","service":"apache","hostname":"devstack","apache_host":"devstack"},"timestamp":1457367034000,"value":0.143419},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367040}')
|
||||
('<message id>','{"metric":{"name":"cpu.stolen_perc","dimensions":{"hostname":"devstack"},"timestamp":1457367034000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367040}')
|
||||
('<message id>','{"metric":{"name":"cpu.user_perc","dimensions":{"hostname":"devstack"},"timestamp":1457367034000,"value":3.9},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367040}')
|
||||
|
@ -284,9 +273,20 @@
|
|||
('<message id>','{"metric":{"name":"cpu.stolen_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457367038000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367043}')
|
||||
('<message id>','{"metric":{"name":"cpu.user_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457367038000,"value":5.3},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367043}')
|
||||
('<message id>','{"metric":{"name":"cpu.total_logical_cores","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457367038000,"value":4.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367043}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457367038000,"value":91.1},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367043}')
|
||||
('<message id>','{"metric":{"name":"cpu.wait_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457367038000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367043}')
|
||||
('<message id>','{"metric":{"name":"cpu.wait_perc","dimensions":{"hostname":"devstack"},"timestamp":1457367049000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367054}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457366977000,"value":90.7},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366980}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"hostname":"devstack"},"timestamp":1457366959000,"value":93.6},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366963}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457366963000,"value":88.0},"meta":{"tenantId":"203e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366966}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"hostname":"devstack"},"timestamp":1457366974000,"value":93.7},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366977}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"hostname":"devstack"},"timestamp":1457366989000,"value":89.0},"meta":{"tenantId":"203e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366991}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457366993000,"value":89.8},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457366994}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"hostname":"devstack"},"timestamp":1457367004000,"value":93.6},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367005}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457367008000,"value":91.2},"meta":{"tenantId":"203e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367008}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"hostname":"devstack"},"timestamp":1457367019000,"value":93.7},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367026}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457367023000,"value":91.2},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367029}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"hostname":"devstack"},"timestamp":1457367034000,"value":92.9},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367040}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"service":"monitoring","hostname":"mini-mon"},"timestamp":1457367038000,"value":91.1},"meta":{"tenantId":"203e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367043}')
|
||||
('<message id>','{"metric":{"name":"cpu.idle_perc","dimensions":{"hostname":"devstack"},"timestamp":1457367049000,"value":93.2},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367054}')
|
||||
('<message id>','{"metric":{"name":"apache.performance.cpu_load_perc","dimensions":{"apache_port":"80","component":"apache","service":"apache","hostname":"devstack","apache_host":"devstack"},"timestamp":1457367049000,"value":0.143422},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367054}')
|
||||
('<message id>','{"metric":{"name":"cpu.stolen_perc","dimensions":{"hostname":"devstack"},"timestamp":1457367049000,"value":0.0},"meta":{"tenantId":"103e4d4d14bc4fdda4a9c73d1643e1d7","region":"useast"},"creation_time":1457367054}')
|
||||
|
@ -318,3 +318,7 @@
|
|||
('<message id>','{"metric":{"name":"vm.cpu.utilization_perc","dimensions":{"resource_id":"a07858d1-aa13-4259-9873-f23170bc9e1b","cloud_name":"poc-hlm-004","component":"vm","control_plane":"ccp","service":"compute","cluster":"compute","hostname":"004-cp1-comp0006-mgmt","tenant_id":"817331145b804dc9a7accb6edfb0674d","zone":"nova"},"timestamp":1464283895000,"value":35.0},"meta":{"tenantId":"e675b49896624464bb2e3152ef92cd11","region":"unset"},"creation_time":1464283972}')
|
||||
('<message id>','{"metric":{"name":"vm.cpu.utilization_perc","dimensions":{"resource_id":"4cd09eac-854d-49eb-993d-914271f8e1fe","cloud_name":"poc-hlm-004","component":"vm","control_plane":"ccp","service":"compute","cluster":"compute","hostname":"004-cp1-comp0006-mgmt","tenant_id":"817331145b804dc9a7accb6edfb0674d","zone":"nova"},"timestamp":1464283896000,"value":15.0},"meta":{"tenantId":"e675b49896624464bb2e3152ef92cd11","region":"unset"},"creation_time":1464283972}')
|
||||
('<message id>','{"metric":{"name":"vm.cpu.utilization_perc","dimensions":{"resource_id":"9cb52342-7670-4ae5-846c-5687946c0311","cloud_name":"poc-hlm-004","component":"vm","control_plane":"ccp","service":"compute","cluster":"compute","hostname":"004-cp1-comp0006-mgmt","tenant_id":"5d0e49bdc4534bb4b65909228aa040da","zone":"nova"},"timestamp":1464283827000,"value":26.0},"meta":{"tenantId":"e675b49896624464bb2e3152ef92cd11","region":"unset"},"creation_time":1464283972}')
|
||||
('<message id>','{"metric":{"name":"disk.total_space_mb","dimensions":{"cloud_name":"helion-poc-hlm-004","control_plane":"ccp","service":"uncategorized","cluster":"compute","hostname":"hlm004-cp1-comp0003-mgmt"},"timestamp":1464815361000,"value":1282121.0},"meta":{"tenantId":"2ee3ccf6f5ab4ab18dbc8ae24fce99e0","region":"unset"},"creation_time":1464815362}')
|
||||
('<message id>','{"metric":{"name":"disk.total_space_mb","dimensions":{"cloud_name":"helion-poc-hlm-004","control_plane":"ccp","service":"uncategorized","cluster":"cluster1","hostname":"hlm004-cp1-c1-m1-mgmt"},"timestamp":1464815364000,"value":1291923.0},"meta":{"tenantId":"2ee3ccf6f5ab4ab18dbc8ae24fce99e0","region":"unset"},"creation_time":1464815364}')
|
||||
('<message id>','{"metric":{"name":"disk.total_used_space_mb","dimensions":{"cloud_name":"helion-poc-hlm-004","control_plane":"ccp","service":"uncategorized","cluster":"compute","hostname":"hlm004-cp1-comp0003-mgmt"},"timestamp":1464815361000,"value":2329.0},"meta":{"tenantId":"2ee3ccf6f5ab4ab18dbc8ae24fce99e0","region":"unset"},"creation_time":1464815362}')
|
||||
('<message id>','{"metric":{"name":"disk.total_used_space_mb","dimensions":{"cloud_name":"helion-poc-hlm-004","control_plane":"ccp","service":"uncategorized","cluster":"cluster1","hostname":"hlm004-cp1-c1-m1-mgmt"},"timestamp":1464815364000,"value":31714.0},"meta":{"tenantId":"2ee3ccf6f5ab4ab18dbc8ae24fce99e0","region":"unset"},"creation_time":1464815364}')
|
||||
|
|
|
@ -92,10 +92,13 @@ class SparkTest(SparkContextTest):
|
|||
# get the metrics that have been submitted to the dummy message adapter
|
||||
metrics = MessageAdapter.adapter_impl.metric_list
|
||||
|
||||
# Verify cpu.total_logical_cores_agg for all hosts
|
||||
total_cpu_logical_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get(
|
||||
'name') == 'cpu.total_logical_cores_agg'][0]
|
||||
if value.get('metric').get('name') ==
|
||||
'cpu.total_logical_cores_agg' and
|
||||
value.get('metric').get('dimensions').get('host') ==
|
||||
'all'][0]
|
||||
|
||||
self.assertEqual(15.0,
|
||||
total_cpu_logical_agg_metric.get(
|
||||
|
@ -106,10 +109,6 @@ class SparkTest(SparkContextTest):
|
|||
self.assertEqual(cfg.CONF.messaging.publish_kafka_tenant_id,
|
||||
total_cpu_logical_agg_metric.get(
|
||||
'meta').get('tenantId'))
|
||||
self.assertEqual('all',
|
||||
total_cpu_logical_agg_metric.get(
|
||||
'metric').get('dimensions')
|
||||
.get('host'))
|
||||
self.assertEqual('all',
|
||||
total_cpu_logical_agg_metric.get(
|
||||
'metric').get('dimensions')
|
||||
|
@ -132,10 +131,91 @@ class SparkTest(SparkContextTest):
|
|||
'metric').get('value_meta')
|
||||
.get('lastrecord_timestamp'))
|
||||
|
||||
# Verify cpu.total_logical_cores_agg for mini-mon host
|
||||
total_cpu_logical_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') ==
|
||||
'cpu.total_logical_cores_agg' and
|
||||
value.get('metric').get('dimensions').get('host') ==
|
||||
'mini-mon'][0]
|
||||
|
||||
self.assertEqual(9.0,
|
||||
total_cpu_logical_agg_metric.get(
|
||||
'metric').get('value'))
|
||||
self.assertEqual('useast',
|
||||
total_cpu_logical_agg_metric.get(
|
||||
'meta').get('region'))
|
||||
self.assertEqual(cfg.CONF.messaging.publish_kafka_tenant_id,
|
||||
total_cpu_logical_agg_metric.get(
|
||||
'meta').get('tenantId'))
|
||||
self.assertEqual('all',
|
||||
total_cpu_logical_agg_metric.get(
|
||||
'metric').get('dimensions')
|
||||
.get('project_id'))
|
||||
self.assertEqual('hourly',
|
||||
total_cpu_logical_agg_metric.get(
|
||||
'metric').get('dimensions')
|
||||
.get('aggregation_period'))
|
||||
|
||||
self.assertEqual(6.0,
|
||||
total_cpu_logical_agg_metric.get(
|
||||
'metric').get('value_meta')
|
||||
.get('record_count'))
|
||||
self.assertEqual('2016-03-07 16:09:23',
|
||||
total_cpu_logical_agg_metric.get(
|
||||
'metric').get('value_meta')
|
||||
.get('firstrecord_timestamp'))
|
||||
self.assertEqual('2016-03-07 16:10:38',
|
||||
total_cpu_logical_agg_metric.get(
|
||||
'metric').get('value_meta')
|
||||
.get('lastrecord_timestamp'))
|
||||
|
||||
# Verify cpu.total_logical_cores_agg for devstack host
|
||||
total_cpu_logical_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') ==
|
||||
'cpu.total_logical_cores_agg' and
|
||||
value.get('metric').get('dimensions').get('host') ==
|
||||
'devstack'][0]
|
||||
|
||||
self.assertEqual(6.0,
|
||||
total_cpu_logical_agg_metric.get(
|
||||
'metric').get('value'))
|
||||
self.assertEqual('useast',
|
||||
total_cpu_logical_agg_metric.get(
|
||||
'meta').get('region'))
|
||||
self.assertEqual(cfg.CONF.messaging.publish_kafka_tenant_id,
|
||||
total_cpu_logical_agg_metric.get(
|
||||
'meta').get('tenantId'))
|
||||
self.assertEqual('all',
|
||||
total_cpu_logical_agg_metric.get(
|
||||
'metric').get('dimensions')
|
||||
.get('project_id'))
|
||||
self.assertEqual('hourly',
|
||||
total_cpu_logical_agg_metric.get(
|
||||
'metric').get('dimensions')
|
||||
.get('aggregation_period'))
|
||||
|
||||
self.assertEqual(7.0,
|
||||
total_cpu_logical_agg_metric.get(
|
||||
'metric').get('value_meta')
|
||||
.get('record_count'))
|
||||
self.assertEqual('2016-03-07 16:09:23',
|
||||
total_cpu_logical_agg_metric.get(
|
||||
'metric').get('value_meta')
|
||||
.get('firstrecord_timestamp'))
|
||||
self.assertEqual('2016-03-07 16:10:38',
|
||||
total_cpu_logical_agg_metric.get(
|
||||
'metric').get('value_meta')
|
||||
.get('lastrecord_timestamp'))
|
||||
|
||||
# Verify cpu.utilized_logical_cores_agg for all hosts
|
||||
utilized_cpu_logical_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get(
|
||||
'name') == 'cpu.utilized_logical_cores_agg'][0]
|
||||
if value.get('metric').get('name') ==
|
||||
'cpu.utilized_logical_cores_agg' and
|
||||
value.get('metric').get('dimensions').get('host') ==
|
||||
'all'][0]
|
||||
|
||||
self.assertEqual(8.0,
|
||||
utilized_cpu_logical_agg_metric.get(
|
||||
|
@ -150,7 +230,43 @@ class SparkTest(SparkContextTest):
|
|||
self.assertEqual('all',
|
||||
utilized_cpu_logical_agg_metric.get(
|
||||
'metric').get('dimensions')
|
||||
.get('host'))
|
||||
.get('project_id'))
|
||||
self.assertEqual('hourly',
|
||||
utilized_cpu_logical_agg_metric.get(
|
||||
'metric').get('dimensions')
|
||||
.get('aggregation_period'))
|
||||
|
||||
self.assertEqual(13.0,
|
||||
utilized_cpu_logical_agg_metric.get(
|
||||
'metric').get('value_meta')
|
||||
.get('record_count'))
|
||||
self.assertEqual('2016-03-07 16:09:23',
|
||||
utilized_cpu_logical_agg_metric.get(
|
||||
'metric').get('value_meta')
|
||||
.get('firstrecord_timestamp'))
|
||||
self.assertEqual('2016-03-07 16:10:38',
|
||||
utilized_cpu_logical_agg_metric.get(
|
||||
'metric').get('value_meta')
|
||||
.get('lastrecord_timestamp'))
|
||||
|
||||
# Verify cpu.utilized_logical_cores_agg for the mini-mon host
|
||||
utilized_cpu_logical_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') ==
|
||||
'cpu.utilized_logical_cores_agg' and
|
||||
value.get('metric').get('dimensions').get('host') ==
|
||||
'mini-mon'][0]
|
||||
|
||||
self.assertEqual(5.0,
|
||||
utilized_cpu_logical_agg_metric.get(
|
||||
'metric').get('value'))
|
||||
self.assertEqual('useast',
|
||||
utilized_cpu_logical_agg_metric.get(
|
||||
'meta').get('region'))
|
||||
|
||||
self.assertEqual(cfg.CONF.messaging.publish_kafka_tenant_id,
|
||||
utilized_cpu_logical_agg_metric.get(
|
||||
'meta').get('tenantId'))
|
||||
self.assertEqual('all',
|
||||
utilized_cpu_logical_agg_metric.get(
|
||||
'metric').get('dimensions')
|
||||
|
@ -160,7 +276,47 @@ class SparkTest(SparkContextTest):
|
|||
'metric').get('dimensions')
|
||||
.get('aggregation_period'))
|
||||
|
||||
self.assertEqual(13.0,
|
||||
self.assertEqual(6.0,
|
||||
utilized_cpu_logical_agg_metric.get(
|
||||
'metric').get('value_meta')
|
||||
.get('record_count'))
|
||||
self.assertEqual('2016-03-07 16:09:23',
|
||||
utilized_cpu_logical_agg_metric.get(
|
||||
'metric').get('value_meta')
|
||||
.get('firstrecord_timestamp'))
|
||||
self.assertEqual('2016-03-07 16:10:38',
|
||||
utilized_cpu_logical_agg_metric.get(
|
||||
'metric').get('value_meta')
|
||||
.get('lastrecord_timestamp'))
|
||||
|
||||
# Verify cpu.utilized_logical_cores_agg for the devstack host
|
||||
utilized_cpu_logical_agg_metric = [
|
||||
value for value in metrics
|
||||
if value.get('metric').get('name') ==
|
||||
'cpu.utilized_logical_cores_agg' and
|
||||
value.get('metric').get('dimensions').get('host') ==
|
||||
'devstack'][0]
|
||||
|
||||
self.assertEqual(3.0,
|
||||
utilized_cpu_logical_agg_metric.get(
|
||||
'metric').get('value'))
|
||||
self.assertEqual('useast',
|
||||
utilized_cpu_logical_agg_metric.get(
|
||||
'meta').get('region'))
|
||||
|
||||
self.assertEqual(cfg.CONF.messaging.publish_kafka_tenant_id,
|
||||
utilized_cpu_logical_agg_metric.get(
|
||||
'meta').get('tenantId'))
|
||||
self.assertEqual('all',
|
||||
utilized_cpu_logical_agg_metric.get(
|
||||
'metric').get('dimensions')
|
||||
.get('project_id'))
|
||||
self.assertEqual('hourly',
|
||||
utilized_cpu_logical_agg_metric.get(
|
||||
'metric').get('dimensions')
|
||||
.get('aggregation_period'))
|
||||
|
||||
self.assertEqual(7.0,
|
||||
utilized_cpu_logical_agg_metric.get(
|
||||
'metric').get('value_meta')
|
||||
.get('record_count'))
|
||||
|
|
|
@ -142,7 +142,7 @@ class TestVmCpuAllocatedAgg(SparkContextTest):
|
|||
result = simple_count_transform(rdd_monasca_with_offsets)
|
||||
|
||||
# Verify it worked
|
||||
self.assertEqual(result, 320)
|
||||
self.assertEqual(result, 324)
|
||||
|
||||
# Call the primary method in mon_metrics_kafka
|
||||
MonMetricsKafkaProcessor.rdd_to_recordstore(
|
||||
|
@ -321,7 +321,7 @@ class TestVmCpuAllocatedAgg(SparkContextTest):
|
|||
result = simple_count_transform(rdd_monasca_with_offsets)
|
||||
|
||||
# Verify it worked
|
||||
self.assertEqual(result, 320)
|
||||
self.assertEqual(result, 324)
|
||||
|
||||
# Call the primary method in mon_metrics_kafka
|
||||
MonMetricsKafkaProcessor.rdd_to_recordstore(
|
||||
|
|
Loading…
Reference in New Issue