1 """Diagnostics for debugging.
3 The stream component does not have config entries itself, and all diagnostics
4 information is managed by dependent components (e.g. camera)
7 from __future__
import annotations
9 from collections
import Counter
10 from typing
import Any
14 """Holds diagnostics counters and key/values."""
17 """Initialize Diagnostics."""
18 self._counter: Counter = Counter()
19 self._values: dict[str, Any] = {}
22 """Increment a counter for the specified key/event."""
23 self._counter.
update(Counter({key: 1}))
26 """Update a key/value pair."""
27 self._values[key] = value
30 """Return diagnostics as a debug dictionary."""
31 result = {k: self._counter[k]
for k
in self._counter}
32 result.update(self._values)
None increment(self, str key)
dict[str, Any] as_dict(self)
None set_value(self, str key, Any value)
IssData update(pyiss.ISS iss)