in src/worker/publisher/metrics_publisher.py [0:0]
def publish_metrics(self, metrics):
"""
Publish the metrics to Geneva according to the metric type
Args:
metrics(list): A list of metrics:
[{'name': metric_name, 'value': metric_value, 'labels': metric_labels, 'type': metric_type}]
"""
if metrics == {}:
return
for metric in metrics:
if metric['type'] == 'counter':
self.publish_counter(metric)
elif metric['type'] == 'gauge':
self.publish_gauge(metric)
else:
print('This metrics type is not supported')