class_docstr: Class for generating metrics and printing it to stdout of the worker
class_docstr_tok: ["Class","for","generating","metrics","and","printing","it","to","stdout","of","the","worker"]
docstr: Constructor for CachingMetric
     CachingMetric reports collected metrics to stdout of worker
  
  Parameters
  ----------
  metric_name str
      Name of metric
  
  unit str
      unit can be one of ms, percent, count, MB, GB or a generic string
  
  dimension_names list
      list of dimension name strings
  
  metric_type MetricTypes
      Type of metric Counter, Gauge, Histogram
docstr_tok: ["Constructor","for","CachingMetric","CachingMetric","reports","collected","metrics","to","stdout","of","worker","Parameters","--","--","--","--","--","metric_name","str","Name","of","metric","unit","str","unit","can","be","one","of","ms",",","percent",",","count",",","MB",",","GB","or","a","generic","string","dimension_names","list","list","of","dimension","name","strings","metric_type","MetricTypes","Type","of","metric","Counter",",","Gauge",",","Histogram"]
code: def __init__(
      self,
      metric_name: str,
      unit: str,
      dimension_names: list = None,
      metric_type: MetricTypes = MetricTypes.COUNTER,
  ):
      """
      Constructor for CachingMetric
         CachingMetric reports collected metrics to stdout of worker
  
      Parameters
      ----------
      metric_name str
          Name of metric
  
      unit str
          unit can be one of ms, percent, count, MB, GB or a generic string
  
      dimension_names list
          list of dimension name strings
  
      metric_type MetricTypes
          Type of metric Counter, Gauge, Histogram
  
      """
      self.metric_name = metric_name
      self.unit = unit
      if unit in list(MetricUnit.units.keys()):
          self.unit = MetricUnit.units[unit]
      self.dimension_names = dimension_names or []
      self.metric_type = metric_type
  
imports: import abc
  from ts.metrics.metric_type_enum import MetricTypes
  from ts.metrics.unit import Units
label_desc: Use image node_id 1 to create a new MetricAbstract object  with example: obj = MetricAbstract(metric_name, unit, dimension_names, metric_type)