docstr: Store new measurements into metrics.json.
docstr_tok: ["Store","new","measurements","into","metrics.json","."]
code: def log_metrics(self, metrics_by_name, info):
      """Store new measurements into metrics.json."""
      for metric_name, metric_ptr in metrics_by_name.items():
          if metric_name not in self.saved_metrics:
              self.saved_metrics[metric_name] = {
                  "values": [],
                  "steps": [],
                  "timestamps": [],
              }
  
          self.saved_metrics[metric_name]["values"] += metric_ptr[
              "values"
          ]
          self.saved_metrics[metric_name]["steps"] += metric_ptr[
              "steps"
          ]
  
          timestamps_norm = [
              ts.isoformat() for ts in metric_ptr["timestamps"]
          ]
          self.saved_metrics[metric_name][
              "timestamps"
          ] += timestamps_norm
  
      self.save_json(self.saved_metrics, "metrics.json")
  
imports: import json
  import os
  import os.path
  import re
  from typing import Optional
  from sacred.commandline_options import cli_option
  from sacred.dependencies import get_digest
  from sacred.observers.base import RunObserver
  from sacred.serializer import flatten
  from sacred.utils import PathType
label_desc: Use image node_id 21 for calling the GoogleCloudStorageObserver obj's underlying member method code with example usage: obj.log_metrics(metrics_by_name, info) without return types