in src/azinsights/collector/PrometheusMetricCollector.py [0:0]
def log_to_current_results(self, job_id: str, vm_instance: str, identifier: str, metric_queried: str, metric_value: str): # noqa: E501
'''Logs individual metric to private instance dictionary.
Parameters
----------
job_id : str
Job id of the job that generated this metric
vm_instance : str
Name of the VM instance that generated this metric
identifier : str
Name of the identifier that generated this metric (i.e. GPU index or IB Port)
metric_queried : str
Name of the metric queried for
metric_value : str
Value of the metric queried for as a string
'''
logger.debug('log_to_current_results')
if self._current_results.get(job_id, None) is None:
self._current_results[job_id] = {}
if self._current_results[job_id].get(vm_instance, None) is None:
self._current_results[job_id][vm_instance] = {}
if self._current_results[job_id][vm_instance].get(identifier, None) is None:
self._current_results[job_id][vm_instance][identifier] = {}
self._current_results[job_id][vm_instance][identifier][metric_queried] = metric_value