code: def metric_recorded(self, record):
      if tuple(record.name) in self.metrics_to_collect:
          target = self.metrics_to_collect[tuple(record.name)]
          self.metric_history[target].append(record.value)
  
file_path: flair/flair/trainers/plugins/loggers/metric_history.py
imports: import logging
  from typing import Any, Dict, Mapping
  from flair.trainers.plugins.base import TrainerPlugin
label_desc: Use image node_id 2 for calling the MetricHistoryPlugin obj's underlying member method code with example usage: obj.metric_recorded(record) without return types