Skip to main content

Module telemetry

Module telemetry 

Source
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§

PamojaReporter
An opaque handle to one reporter and its counters.
PamojaTelemetrySnapshot
A count of everything a reporter has seen, cheap enough to ship anywhere.

Enums§

PamojaLinkCost
What the link back to the network currently costs.
PamojaTelemetryLevel
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.