docstr: A method that processes the metrics recorded during the benchmark.
  
  Returns::
      It returns a dictionary containing keys as the metrics
          and values list of elapsed times.
  
  Examples::
  
      >>> instance = MetricsLogger(rank)
      >>> instance.cuda_record_start("forward_metric_type", "1", "forward_pass")
      >>> instance.cuda_record_end("forward_metric_type", "1")
      >>> instance.cuda_record_start("forward_metric_type", "2", "forward_pass")
      >>> instance.cuda_record_end("forward_metric_type", "2")
      >>> print(instance.metrics)
      {
          "forward_metric_type": {
              "1": metric1,
              "2": metric2
          }
      }
  
      >>> print(instance.get_processed_metrics())
      {
          "forward_metric_type,forward_pass" : [.0429, .0888]
      }
docstr_tok: ["A","method","that","processes","the","metrics","recorded","during","the","benchmark",".","Returns",":",":","It","returns","a","dictionary","containing","keys","as","the","metrics","and","values","list","of","elapsed","times",".","Examples",":",":",">",">",">","instance","=","MetricsLogger","(","rank",")",">",">",">","instance.cuda_record_start","(","``","forward_metric_type","''",",","``","1","''",",","``","forward_pass","''",")",">",">",">","instance.cuda_record_end","(","``","forward_metric_type","''",",","``","1","''",")",">",">",">","instance.cuda_record_start","(","``","forward_metric_type","''",",","``","2","''",",","``","forward_pass","''",")",">",">",">","instance.cuda_record_end","(","``","forward_metric_type","''",",","``","2","''",")",">",">",">","print","(","instance.metrics",")","{","``","forward_metric_type","''",":","{","``","1","''",":","metric1",",","``","2","''",":","metric2","}","}",">",">",">","print","(","instance.get_processed_metrics","(",")",")","{","``","forward_metric_type",",","forward_pass","''",":","[",".0429",",",".0888","]","}"]
code: def get_processed_metrics(self):
      r"""
      A method that processes the metrics recorded during the benchmark.
  
      Returns::
          It returns a dictionary containing keys as the metrics
              and values list of elapsed times.
  
      Examples::
  
          >>> instance = MetricsLogger(rank)
          >>> instance.cuda_record_start("forward_metric_type", "1", "forward_pass")
          >>> instance.cuda_record_end("forward_metric_type", "1")
          >>> instance.cuda_record_start("forward_metric_type", "2", "forward_pass")
          >>> instance.cuda_record_end("forward_metric_type", "2")
          >>> print(instance.metrics)
          {
              "forward_metric_type": {
                  "1": metric1,
                  "2": metric2
              }
          }
  
          >>> print(instance.get_processed_metrics())
          {
              "forward_metric_type,forward_pass" : [.0429, .0888]
          }
      """
      processed_metrics = {}
      for metric_type in self.metrics.keys():
          for metric_key in self.metrics[metric_type].keys():
              metric = self.metrics[metric_type][metric_key]
              if isinstance(metric, CUDAMetric):
                  metric.synchronize()
              metric_name = metric.get_name()
              elapsed_time = metric.elapsed_time()
              processed_metric_name = f"{metric_type},{metric_name}"
              if processed_metric_name not in processed_metrics:
                  processed_metrics[processed_metric_name] = []
              processed_metrics[processed_metric_name].append(
                  elapsed_time
              )
      return processed_metrics
  
file_path: pytorch/benchmarks/distributed/rpc/parameter_server/metrics/MetricsLogger.py
imports: from .CPUMetric import CPUMetric
  from .CUDAMetric import CUDAMetric
label_desc: Use image node_id 6 for calling the MetricsLogger obj's underlying member method code with example usage: obj.get_processed_metrics() and returns: processed_metrics