class_docstr: Collects metrics and sends them directly to metrics service.
class_docstr_tok: ["Collects","metrics","and","sends","them","directly","to","metrics","service","."]
docstr: Sends a metric to metrics service.
docstr_tok: ["Sends","a","metric","to","metrics","service","."]
code: def log_metric(self, metric_data):
      """Sends a metric to metrics service."""
  
      if metric_data.MetricName in self._metric_queues:
          self._metric_queues[metric_data.MetricName].log_metric(
              metric_data
          )
      else:
          cur_metric_queue = _MetricQueue(
              self._trial_component_name,
              metric_data.MetricName,
              self._metrics_client,
          )
          self._metric_queues[metric_data.MetricName] = cur_metric_queue
          cur_metric_queue.log_metric(metric_data)
  
imports: from __future__ import absolute_import
  import datetime
  import logging
  import os
  import time
  import threading
  import queue
  import dateutil.tz
  from sagemaker.session import Session
label_desc: Use image node_id 2 for calling the _AsyncMetricsSink obj's underlying member method code with example usage: obj.log_metric(metric_data) without return types