in src/azinsights/collector/PrometheusMetricCollector.py [0:0]
def collect_metrics_of_type(self, organizer: MetricOrganizer, metric_list: list):
'''Collects metrics of a specific given type
Parameters
----------
organizer : MetricOrganizer
An instance of a subclass of MetricOrganizer that can organize metrics in the given list
metric_list : list
A list of metric names of the same type that can be organized through the previous parameter
'''
logger.debug('collect_metrics_of_type')
for metric in metric_list:
response = self.query_prometheus(metric)
if (PrometheusMetricCollector.successful_response(response)):
organized_metrics = organizer.organize_metric(response)
for organized_metric in organized_metrics:
job_id, vm_instance, identifier, metric_queried, metric_value = organized_metric
self.log_to_current_results(job_id, vm_instance, identifier, metric_queried, metric_value)