class_docstr: Controls saving and loading of workspaces on every epoch boundary of a job.
  If a CheckpointManager instance is passed to JobRunner, then JobRunner will
  call `init`, `read` and `save` at different moments in between epoch runs.
  
  Args:
      db_prefix: The prefix used to construct full db name. Since `absolute_path`
          is set to True, this will be used as db_name in SaveOp.
      node_name: Name of the node where this checkpoint_manager is used.
      db_type: Type of database to use for storing checkpoint.
      metadata_handler: An optional object capable of reading/writing
          checkpoint info in storage of choice.
class_docstr_tok: ["Controls","saving","and","loading","of","workspaces","on","every","epoch","boundary","of","a","job",".","If","a","CheckpointManager","instance","is","passed","to","JobRunner",",","then","JobRunner","will","call","`","init","`",",","`","read","`","and","`","save","`","at","different","moments","in","between","epoch","runs",".","Args",":","db_prefix",":","The","prefix","used","to","construct","full","db","name",".","Since","`","absolute_path","`","is","set","to","True",",","this","will","be","used","as","db_name","in","SaveOp",".","node_name",":","Name","of","the","node","where","this","checkpoint_manager","is","used",".","db_type",":","Type","of","database","to","use","for","storing","checkpoint",".","metadata_handler",":","An","optional","object","capable","of","reading\/writing","checkpoint","info","in","storage","of","choice","."]
docstr: Add one checkpoint stats into the stats.
  
  Args:
      stats: A dict of checkpoint stats that will be reported.
docstr_tok: ["Add","one","checkpoint","stats","into","the","stats",".","Args",":","stats",":","A","dict","of","checkpoint","stats","that","will","be","reported","."]
code: def collect_checkpoint_stats(self, stats):
      """
      Add one checkpoint stats into the stats.
  
      Args:
          stats: A dict of checkpoint stats that will be reported.
      """
      if self._current_db_name and self._current_checkpoint_duration:
          stats[
              self._current_db_name
          ] = self._current_checkpoint_duration.fetch()[0]
      else:
          logger.info(
              "Failed to collect checkpoint stats: {}".format(
                  self._current_db_name
              )
          )
  
imports: import os
  import logging
  from caffe2.python import core, context
  from caffe2.python.net_builder import ops
  from caffe2.python.task import final_output, Node, Task, TaskGroup, TaskOutput, WorkspaceType
label_desc: Use image node_id 5 for calling the CheckpointManager obj's underlying member method code with example usage: obj.collect_checkpoint_stats(stats) without return types