Skip to content

beryl/stats

Local coordinator statistics.

Snapshots are point-in-time values captured when the local coordinator services a request. They are intended for operational polling, not as an event stream. Poll no more frequently than roughly once per second so observation does not add meaningful coordinator load.

A point-in-time snapshot of local coordinator state.

pub type Snapshot

Errors returned while requesting a coordinator snapshot.

pub type SnapshotError {
CoordinatorUnavailable
RequestTimedOut
}

The local coordinator is not currently running.

The coordinator did not service the request within the bounded timeout.

Return the number of topics with at least one local joined socket.

pub fn active_topics(Snapshot) -> Int

Return the number of sockets connected to the local coordinator.

pub fn connected_sockets(Snapshot) -> Int

Return the coordinator mailbox length when it serviced the request.

pub fn coordinator_mailbox_length(Snapshot) -> Int

Return the number of joined socket/topic pairs.

One socket joined to two topics contributes two pairs.

pub fn joined_socket_topic_pairs(Snapshot) -> Int

Return the number of channel handlers registered with the coordinator.

pub fn registered_channel_handlers(Snapshot) -> Int

Request a point-in-time snapshot from the local coordinator.

The request waits for at most approximately one second. During a coordinator restart this returns CoordinatorUnavailable or RequestTimedOut; an overloaded coordinator returns RequestTimedOut. Neither condition panics. This API reports only the node represented by channels; aggregate multi-node statistics outside Beryl.

Poll no more frequently than roughly once per second.

pub fn snapshot(beryl.Channels) -> Result(Snapshot, SnapshotError)