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 compound statistic with this sensor which
  yields multiple measurable quantities (like a histogram)
  
  Arguments:
      stat (AbstractCompoundStat): The stat to register
      config (MetricConfig): The configuration for this stat.
          If None then the stat will use the default configuration
          for this sensor.
docstr_tok: ["Register","a","compound","statistic","with","this","sensor","which","yields","multiple","measurable","quantities","(","like","a","histogram",")","Arguments",":","stat","(","AbstractCompoundStat",")",":","The","stat","to","register","config","(","MetricConfig",")",":","The","configuration","for","this","stat",".","If","None","then","the","stat","will","use","the","default","configuration","for","this","sensor","."]
code: def add_compound(self, compound_stat, config=None):
      """
      Register a compound statistic with this sensor which
      yields multiple measurable quantities (like a histogram)
  
      Arguments:
          stat (AbstractCompoundStat): The stat to register
          config (MetricConfig): The configuration for this stat.
              If None then the stat will use the default configuration
              for this sensor.
      """
      if not compound_stat:
          raise ValueError("compound stat must be non-empty")
      self._stats.append(compound_stat)
      for named_measurable in compound_stat.stats():
          metric = KafkaMetric(
              named_measurable.name,
              named_measurable.stat,
              config or self._config,
          )
          self._registry.register_metric(metric)
          self._metrics.append(metric)
  
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 7 for calling the Sensor obj's underlying member method code with example usage: obj.add_compound(compound_stat, config) without return types