CPU metrics

This file initiates the script to extract real time cpu metrics

class monitormetrics.cpumetrics.cpumetrics.MonitorCPUMetrics(config)[source]

Engine to monitor cpu related metrics

add_ib_counters_to_dict()[source]

Add IB counters to base dict

add_mem_bw_to_dict()[source]

Add memory bandwidth to base dict

add_metrics_cpu_parameters()[source]

This method adds metrics key/value pair in cpu parameter dict

add_rapl_domains_to_dict()[source]

Add RAPL domain names to base dict

add_timestamp()[source]

This method adds timestamp to the data

check_availability_ib_rapl_membw()[source]

This method checks if infiniband and RAPL metrics are available

check_metric_data()[source]

This method checks if all the metric data is consistent with number of timestamps

dump_metrics()[source]

Dump metrics to JSON file and re-initiate cpu_metrics dict

get_cpu_percent()[source]

This method gives CPU percent of parent and its childs

get_cpu_time_from_parent_and_childs()[source]

This method gets cumulative CPU time from parent and its childs

get_cpu_usage()[source]

This method gets all CPU usage statistics

get_cumulative_metric_value(metric_type)[source]

This method gets cumulative metric account for all childs for a given metric type

get_energy_metrics()[source]

This method gets energy metrics from RAPL powercap interface

get_ib_io_counters()[source]

This method gets the Infiniband port counters

get_memory_bandwidth()[source]

This method returns memory bandwidth based on perf LLC load misses event

get_memory_usage()[source]

This method gets memory usage

get_metrics_data()[source]

Extract metrics data

get_misc_metrics()[source]

This method gets IO, file descriptors and thread count

get_network_traffic()[source]

Get network traffic from TCP and Infiniband (if supported)

get_sys_wide_net_io_counters()[source]

This method gets the system wide network IO counters

initialise_cpu_metrics_params()[source]

This method initialises the CPU metric related parameters

run()[source]

This method extracts the cpu related metrics for a given pid