TelemetryRegistry
The set of TelemetryBackends that logged values are routed to, plus the clock that stamps them.
Most code uses Telemetry, which wraps one shared registry. This is a class so a test can build its own with a kotlin.time.TestTimeSource and a mock backend without affecting anything else.
Timestamps
Every value is stamped in microseconds since origin, as measured by timeSource. Give the same source and origin to a log writer and a server and they agree with this registry on every timestamp.
Backends
A registered backend receives every value, or only the values whose path is under the prefixes it was registered with. Backends can change while other threads are logging. Handles notice the change on their next value and ask the new set of backends for their entries.
Warnings
Telemetry reports a wrong type, a value it can't log, or a backend that threw through warningHandler, then carries on, so a bad value can't crash an OpMode. Each distinct message is reported once, so a bad value logged every loop doesn't flood the output.
Parameters
The clock that stamps values
The moment timestamp zero refers to, a mark from timeSource. The default is the moment the registry is created.
Throws
if origin isn't from timeSource, or is in the future
Constructors
Properties
How many backends are registered.
The handlers that log values of types that can't log themselves. By default this includes one for Measure.
The root table, whose path is empty.
Builds and keeps the schemas of the classes that are logged as structs. By default this includes the control geometry types.
Where warnings go. The default prints to standard error. A handler must not throw, and may be called from any thread.
Functions
Adds backend. It receives every value logged after this call, including on paths that were already being logged.
Returns the table name under the root, creating it if needed.
Removes backend without closing it.
Reports message to warningHandler, unless this exact message has been reported before. After 1000 distinct messages, new ones are dropped.