Expand description
The C ABI for device-side telemetry.
These functions wrap [pamoja_telemetry] for callers that reach the SDK
through the flat C boundary: a reporter that ships the events worth their
bytes, counts every event it sees whether it ships or not, and moves its own
bar as the link gets more expensive.
A reporter holds counters across calls, so it crosses as an opaque handle. Only the level of an event crosses with it, because the level is the whole of what the reporter decides on: the code and the optional value belong to the caller, which keeps them alongside.
Structs§
- Pamoja
Reporter - An opaque handle to one reporter and its counters.
- Pamoja
Telemetry Snapshot - A count of everything a reporter has seen, cheap enough to ship anywhere.
Enums§
- Pamoja
Link Cost - What the link back to the network currently costs.
- Pamoja
Telemetry Level - How urgent an event is.
Constants§
- PAMOJA_
TELEMETRY_ LEVEL_ COUNT - The number of severity levels, which is the width of a snapshot.
Functions§
- pamoja_
link_ cost_ threshold - Returns the level a link cost calls for.
- pamoja_
reporter_ ⚠adapt_ to - Moves the threshold to match what the link now costs.
- pamoja_
reporter_ ⚠count - Returns how many events a reporter has seen at a level, shipped or not.
- pamoja_
reporter_ ⚠dropped - Returns how many events the threshold dropped.
- pamoja_
reporter_ ⚠emitted - Returns how many events passed the threshold and were shipped.
- pamoja_
reporter_ ⚠free - Releases a reporter handle.
- pamoja_
reporter_ new - Creates a reporter that ships events at or above a level.
- pamoja_
reporter_ ⚠record - Records an event and reports whether it is worth shipping.
- pamoja_
reporter_ ⚠set_ threshold - Moves the level a reporter ships from.
- pamoja_
reporter_ ⚠snapshot - Takes a snapshot of the counters to ship in place of the event stream.
- pamoja_
reporter_ ⚠threshold - Returns the level a reporter is currently shipping from.
- pamoja_
reporter_ ⚠total - Returns how many events a reporter has seen across every level.