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"]
code: def __str__(self):
      dims = ",".join([str(d) for d in self.dimensions])
      if self.request_id:
          return (
              f"{self.name}.{self.unit}:{self.value}|#{dims}|#hostname:{socket.gethostname()},"
              f"{int(time.time())},{self.request_id}"
          )
  
      return f"{self.name}.{self.unit}:{self.value}|#{dims}|#hostname:{socket.gethostname()},{int(time.time())}"
  
file_path: serve/ts/metrics/metric.py
imports: import socket
  import time
  from builtins import str
  from collections import OrderedDict
  from ts.metrics.caching_metric import CachingMetric
  from ts.metrics.metric_type_enum import MetricTypes
  from ts.metrics.unit import Units
label_desc: Use image node_id 4 for calling the Metric obj's underlying member method code with example usage: obj.__str__() and returns: self, str, self, str, self, str, dims, str, socket, str, int, self, str, self, str, self, str, dims, str, socket, str, int, str, self