class AzureStandardMetricsProducer(MetricProducer): """Implementation of the producer of standard metrics. Includes Azure specific standard metrics, implemented using gauges. """ def __init__(self): self.registry = Registry() self.registry.add_gauge(get_available_memory_metric()) self.registry.add_gauge(get_process_private_bytes_metric()) self.registry.add_gauge(get_process_cpu_usage_metric()) self.registry.add_gauge(get_processor_time_metric()) def get_metrics(self): return self.registry.get_metrics()
def register_metrics(): registry = Registry() for standard_metric in STANDARD_METRICS: metric = standard_metric() registry.add_gauge(metric()) return registry
def __init__(self): self.registry = Registry() self.registry.add_gauge(get_available_memory_metric()) self.registry.add_gauge(get_process_private_bytes_metric()) self.registry.add_gauge(get_processor_time_metric())