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","."]
code: def __init__(
      self,
      registry,
      name,
      parents,
      config,
      inactive_sensor_expiration_time_seconds,
  ):
      if not name:
          raise ValueError("name must be non-empty")
      self._lock = threading.RLock()
      self._registry = registry
      self._name = name
      self._parents = parents or []
      self._metrics = []
      self._stats = []
      self._config = config
      self._inactive_sensor_expiration_time_ms = (
          inactive_sensor_expiration_time_seconds * 1000
      )
      self._last_record_time = time.time() * 1000
      self._check_forest(set())
  
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 1 to create a new Sensor object from inherited base classes: object with example: obj = Sensor(registry, name, parents, config, inactive_sensor_expiration_time_seconds)