beryl/snapshot
A point-in-time snapshot of local runtime state.
Snapshots are point-in-time values as observed by the runtime process servicing the request. Counts may lag in-flight connect and disconnect notifications that have not yet reached that process, so they are eventually consistent rather than exact at the instant of the call. 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 runtime load.
Snapshot
Section titled “Snapshot”pub type SnapshotA point-in-time snapshot of local runtime state.
SnapshotError
Section titled “SnapshotError”pub type SnapshotError { RuntimeUnavailable RequestTimedOut AdmissionRejected(overload.AdmissionError)}Errors from a runtime snapshot request.
Constructors
Section titled “Constructors”RuntimeUnavailable
Section titled “RuntimeUnavailable”RuntimeUnavailableThe local socket runtime is not running.
RequestTimedOut
Section titled “RequestTimedOut”RequestTimedOutThe runtime did not process the request before the timeout.
AdmissionRejected
Section titled “AdmissionRejected”AdmissionRejected(overload.AdmissionError)The request did not enter the runtime queue.
Functions
Section titled “Functions”active_topics
Section titled “active_topics”pub fn active_topics(Snapshot) -> IntReturn the number of topics with at least one local joined socket.
connected_sockets
Section titled “connected_sockets”pub fn connected_sockets(Snapshot) -> IntReturn the number of sockets connected to the local runtime.
pub fn get(beryl.Sockets) -> Result(Snapshot, SnapshotError)Request a snapshot from the local runtime.
The request waits for about one second at most. During a runtime restart,
this function returns RuntimeUnavailable or RequestTimedOut. An
full runtime queue returns AdmissionRejected.
Neither condition panics. This API reports only the node represented by
sockets; aggregate multi-node statistics outside beryl.
Poll no more frequently than roughly once per second.
joined_socket_topic_pairs
Section titled “joined_socket_topic_pairs”pub fn joined_socket_topic_pairs(Snapshot) -> IntReturn the number of joined socket/topic pairs.
One socket joined to two topics contributes two pairs.
pub fn queue(beryl.Sockets) -> Result(overload.Occupancy, overload.AdmissionError)Read local router admission accounting without waiting for a router turn.
