class_docstr: A sensor applies a continuous sequence of numerical values
  to a set of associated metrics. For example a sensor on
  message size would record a sequence of message sizes using
  the `record(double)` api and would maintain a set
  of metrics about request sizes such as the average or max.
class_docstr_tok: ["A","sensor","applies","a","continuous","sequence","of","numerical","values","to","a","set","of","associated","metrics",".","For","example","a","sensor","on","message","size","would","record","a","sequence","of","message","sizes","using","the","`","record","(","double",")","`","api","and","would","maintain","a","set","of","metrics","about","request","sizes","such","as","the","average","or","max","."]
docstr: Register a metric with this sensor
  
  Arguments:
      metric_name (MetricName): The name of the metric
      stat (AbstractMeasurableStat): The statistic to keep
      config (MetricConfig): A special configuration for this metric.
          If None use the sensor default configuration.
docstr_tok: ["Register","a","metric","with","this","sensor","Arguments",":","metric_name","(","MetricName",")",":","The","name","of","the","metric","stat","(","AbstractMeasurableStat",")",":","The","statistic","to","keep","config","(","MetricConfig",")",":","A","special","configuration","for","this","metric",".","If","None","use","the","sensor","default","configuration","."]
code: def add(self, metric_name, stat, config=None):
      """
      Register a metric with this sensor
  
      Arguments:
          metric_name (MetricName): The name of the metric
          stat (AbstractMeasurableStat): The statistic to keep
          config (MetricConfig): A special configuration for this metric.
              If None use the sensor default configuration.
      """
      with self._lock:
          metric = KafkaMetric(
              metric_name, stat, config or self._config
          )
          self._registry.register_metric(metric)
          self._metrics.append(metric)
          self._stats.append(stat)
  
file_path: kafka-python/kafka/metrics/stats/sensor.py
imports: from __future__ import absolute_import
  import threading
  import time
  from kafka.errors import QuotaViolationError
  from kafka.metrics import KafkaMetric
label_desc: Use image node_id 8 for calling the Sensor obj's underlying member method code with example usage: obj.add(metric_name, stat, config) without return types