class_docstr: Common methods used in PerfZero Benchmarks.
  
  Handles the resetting of flags between tests. PerfZero (OSS) runs each test
  in a separate process reducing some need to reset the flags.
class_docstr_tok: ["Common","methods","used","in","PerfZero","Benchmarks",".","Handles","the","resetting","of","flags","between","tests",".","PerfZero","(","OSS",")","runs","each","test","in","a","separate","process","reducing","some","need","to","reset","the","flags","."]
docstr: Builds a dictionary representing the metric to record.
  
  Args:
    name: Name of the metric.
    value: Value of the metric.
    min_value: Lowest acceptable value.
    max_value: Highest acceptable value.
  
  Returns:
    Dictionary representing the metric.
docstr_tok: ["Builds","a","dictionary","representing","the","metric","to","record",".","Args",":","name",":","Name","of","the","metric",".","value",":","Value","of","the","metric",".","min_value",":","Lowest","acceptable","value",".","max_value",":","Highest","acceptable","value",".","Returns",":","Dictionary","representing","the","metric","."]
code: def build_metric(
      self,
      name: str,
      value: Number,
      min_value: Optional[Number] = None,
      max_value: Optional[Number] = None,
  ):
      """Builds a dictionary representing the metric to record.
  
      Args:
        name: Name of the metric.
        value: Value of the metric.
        min_value: Lowest acceptable value.
        max_value: Highest acceptable value.
  
      Returns:
        Dictionary representing the metric.
      """
      metric = {
          "name": name,
          "value": value,
      }
  
      if min_value:
          metric["min_value"] = min_value
  
      if max_value:
          metric["max_value"] = max_value
  
      return metric
  
file_path: agents/tf_agents/benchmark/perfzero_benchmark.py
imports: import os
  from typing import Optional, Union
  from absl import flags
  from absl import logging
  from absl.testing import flagsaver
  import tensorflow
label_desc: Use image node_id 4 for calling the PerfZeroBenchmark obj's underlying member method code with example usage: obj.build_metric(name, value, min_value, max_value) and returns: metric