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: Logs metrics to
  Parameters
  ----------
  request_id
  value
  dimension_string
docstr_tok: ["Logs","metrics","to","Parameters","--","--","--","--","--","request_id","value","dimension_string"]
code: def emit_metrics(
      self,
      request_id: str,
      value: int or float,
      dimension_string: str,
  ) -> None:
      """
      Logs metrics to
      Parameters
      ----------
      request_id
      value
      dimension_string
      """
      metric_str = (
          f"[METRICS]{self.metric_name}.{self.unit}:{value}|#{dimension_string}|"
          f"#type:{self.metric_type.name}|#hostname:{socket.gethostname()},{int(time.time())}"
      )
      if request_id:
          logger.info(f"{metric_str},{request_id}")
      else:
          logger.info(metric_str)
  
file_path: serve/ts/metrics/caching_metric.py
imports: import logging
  import socket
  import time
  from ts.metrics.dimension import Dimension
  from ts.metrics.metric_abstract import MetricAbstract
  from ts.metrics.metric_type_enum import MetricTypes
label_desc: Use image node_id 4 for calling the CachingMetric obj's underlying member method code with example usage: obj.emit_metrics(request_id, value, dimension_string) without return types