class_docstr: Class to log the benchmark information to STDOUT.
class_docstr_tok: ["Class","to","log","the","benchmark","information","to","STDOUT","."]
docstr: Log the benchmark metric information to local file.
  
  Currently the logging is done in a synchronized way. This should be updated
  to log asynchronously.
  
  Args:
    name: string, the name of the metric to log.
    value: number, the value of the metric. The value will not be logged if it
      is not a number type.
    unit: string, the unit of the metric, E.g "image per second".
    global_step: int, the global_step when the metric is logged.
    extras: map of string:string, the extra information about the metric.
docstr_tok: ["Log","the","benchmark","metric","information","to","local","file",".","Currently","the","logging","is","done","in","a","synchronized","way",".","This","should","be","updated","to","log","asynchronously",".","Args",":","name",":","string",",","the","name","of","the","metric","to","log",".","value",":","number",",","the","value","of","the","metric",".","The","value","will","not","be","logged","if","it","is","not","a","number","type",".","unit",":","string",",","the","unit","of","the","metric",",","E.g","``","image","per","second","''",".","global_step",":","int",",","the","global_step","when","the","metric","is","logged",".","extras",":","map","of","string",":","string",",","the","extra","information","about","the","metric","."]
code: def log_metric(
      self, name, value, unit=None, global_step=None, extras=None
  ):
      """Log the benchmark metric information to local file.
  
      Currently the logging is done in a synchronized way. This should be updated
      to log asynchronously.
  
      Args:
        name: string, the name of the metric to log.
        value: number, the value of the metric. The value will not be logged if it
          is not a number type.
        unit: string, the unit of the metric, E.g "image per second".
        global_step: int, the global_step when the metric is logged.
        extras: map of string:string, the extra information about the metric.
      """
      metric = _process_metric_to_json(
          name, value, unit, global_step, extras
      )
      if metric:
          tf.compat.v1.logging.info("Benchmark metric: %s", metric)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import contextlib
  import datetime
  import json
  import multiprocessing
  import numbers
  import os
  import threading
  import uuid
  from six.moves import _thread
  from absl import flags
  import tensorflow
  from tensorflow.python.client import device_lib
  from utils.logs import cloud_lib
label_desc: Use image node_id 2 for calling the BaseBenchmarkLogger obj's underlying member method code with example usage: obj.log_metric(name, value, unit, global_step, extras) without return types