class_docstr: Serializable struct for holding runtime trial metadata.
  
  Runtime metadata is data that changes and is updated on runtime. This includes
  e.g. the last result, the currently available checkpoints, and the number
  of errors encountered for a trial.
class_docstr_tok: ["Serializable","struct","for","holding","runtime","trial","metadata",".","Runtime","metadata","is","data","that","changes","and","is","updated","on","runtime",".","This","includes","e.g",".","the","last","result",",","the","currently","available","checkpoints",",","and","the","number","of","errors","encountered","for","a","trial","."]
code: def __init__(self, n_steps: Tuple[int] = (5, 10)):
      # General metadata
      self.start_time = None
  
      # Errors
      self.num_failures = 0
      self.num_failures_after_restore = 0
  
      self.error_filename = None
      self.pickled_error_filename = None
  
      # Results and metrics
      self.last_result = {}
      self.last_result_time = -float("inf")
  
      # stores in memory max/min/avg/last-n-avg/last result for each
      # metric by trial
      self.metric_analysis = {}
      self._n_steps = n_steps
      self.metric_n_steps = {}
  
      # Checkpoints
      self.checkpoint_manager: Optional[_CheckpointManager] = None
  
      self._cached_json = None
  
file_path: ray/python/ray/tune/trainable/metadata.py
imports: import json
  from collections import deque
  from numbers import Number
  from typing import Tuple, Optional
  from ray.train._internal.checkpoint_manager import _CheckpointManager
  from ray.tune.utils.serialization import TuneFunctionEncoder, TuneFunctionDecoder
label_desc: Use image node_id 1 to create a new _TrainingRunMetadata object  with example: obj = _TrainingRunMetadata(n_steps)