Skip to main content

Module stats

Module stats 

Source
Expand description

Pool, server, and peer metrics with histograms and a JSON snapshot.

The stats subsystem is split into small modules:

Stats glues the pieces together: a writer accumulates counters, gauges, and histogram observations; a periodic aggregator publishes a fresh Snapshot that the REST endpoint serves.

Structs§

Aggregator
Async aggregator handle: snapshots at a fixed interval into a shared cell that the REST server reads from.
FailureMetrics
Live, mutable accumulator for failure-cause counters.
FailureSnapshot
Immutable snapshot of every failure-cause metric.
Histogram
A fixed-bucket histogram for tracking latencies and payload sizes.
HistogramSummary
Pre-computed quantile summary derived from a Histogram.
MetricSpec
Static descriptor for a metric: how it is interpreted, what its canonical lower-case name is, and a one-line human description.
NoTargetsEntry
A single labeled dispatch_no_targets_total row.
PeerEntry
A single labeled per-peer dispatch error row.
PeerStateEntry
A single labeled peer_state_current gauge row.
PeerStats
Per-peer collected metrics. Mirrors ServerStats for cluster peers.
PhiEntry
A single labeled gossip_phi_score gauge row.
PoolStats
Per-pool collected metrics.
ServerStats
Per-datastore-server collected metrics.
ServiceInfo
Engine-wide identifying strings included in every snapshot.
Snapshot
Aggregate snapshot of the stats subsystem at a point in time.
Stats
Live, mutable counters and histograms for a single engine instance.
StatsServer
A bound TCP listener serving the stats endpoint.
TimeoutEntry
A single labeled dispatch_response_timeout_total row.
TransitionEntry
A single labeled peer_state_transitions_total row.

Enums§

Latency
Channels used to mutate histogram observations.
PoolField
Typed handle for a pool metric.
QueueGauge
Channels used for queue-length observations (observed at sample time, not events).
QueueWait
Channels used for queue-wait-time observations.
ServerField
Typed handle for a server metric.
StatsMetricType
Kind of metric tracked by the stats subsystem.

Constants§

BUCKET_COUNT
Number of buckets in the estimated histogram.
MAX_HEADERS
Maximum number of headers parsed in a single request.
MAX_REQUEST_BYTES
Maximum number of bytes the server will read for an HTTP request line plus headers. Requests larger than this are rejected.
POOL_CODEC
Const slice of every pool metric descriptor in declaration order.
SERVER_CODEC
Const slice of every server metric descriptor in declaration order.

Functions§

describe_stats
Returns the human-readable description block printed by the -D command-line flag.
render_prometheus
Render a Snapshot in the Prometheus 0.0.4 text exposition format.

Type Aliases§

ClusterInfoProvider
Type alias for a closure that produces a fresh ClusterInfoSnapshot every time the /cluster-info.txt route is hit.