pub struct Snapshot {Show 27 fields
pub info: ServiceInfo,
pub uptime: i64,
pub timestamp: i64,
pub latency: HistogramSummary,
pub payload_size: HistogramSummary,
pub cross_region_latency: HistogramSummary,
pub cross_zone_latency: HistogramSummary,
pub server_latency: HistogramSummary,
pub cross_region_queue_wait: HistogramSummary,
pub cross_zone_queue_wait: HistogramSummary,
pub server_queue_wait: HistogramSummary,
pub client_out_queue_p99: u64,
pub server_in_queue_p99: u64,
pub server_out_queue_p99: u64,
pub dnode_client_out_queue_p99: u64,
pub peer_in_queue_p99: u64,
pub peer_out_queue_p99: u64,
pub remote_peer_in_queue_p99: u64,
pub remote_peer_out_queue_p99: u64,
pub alloc_msgs: i64,
pub free_msgs: i64,
pub alloc_mbufs: i64,
pub free_mbufs: i64,
pub dyn_memory: i64,
pub pool: PoolStats,
pub server: ServerStats,
pub failure: FailureSnapshot,
}Expand description
Aggregate snapshot of the stats subsystem at a point in time.
This is the value rendered by Snapshot::to_json and exposed
through the REST endpoint. It is Send + Sync and cheap to clone.
Fields§
§info: ServiceInfoStatic identification strings.
uptime: i64Seconds since the engine started.
timestamp: i64Wall-clock seconds since UNIX epoch.
latency: HistogramSummaryLatency histogram summary.
payload_size: HistogramSummaryPayload size histogram summary.
cross_region_latency: HistogramSummaryCross-region RTT histogram summary.
cross_zone_latency: HistogramSummaryCross-zone latency histogram summary.
server_latency: HistogramSummaryPer-server latency summary.
cross_region_queue_wait: HistogramSummaryCross-region queue wait time summary.
cross_zone_queue_wait: HistogramSummaryCross-zone queue wait time summary.
server_queue_wait: HistogramSummaryServer queue wait time summary.
client_out_queue_p99: u6499th percentile of the client outbound queue length.
server_in_queue_p99: u6499th percentile of the server inbound queue length.
server_out_queue_p99: u6499th percentile of the server outbound queue length.
dnode_client_out_queue_p99: u6499th percentile of the dnode client outbound queue length.
peer_in_queue_p99: u6499th percentile of the local-DC peer inbound queue length.
peer_out_queue_p99: u6499th percentile of the local-DC peer outbound queue length.
remote_peer_in_queue_p99: u6499th percentile of the remote-DC peer inbound queue length.
remote_peer_out_queue_p99: u6499th percentile of the remote-DC peer outbound queue length.
alloc_msgs: i64Number of message structs allocated.
free_msgs: i64Number of message structs on the free list.
alloc_mbufs: i64Number of mbuf chunks allocated.
free_mbufs: i64Number of mbuf chunks on the free list.
dyn_memory: i64Resident set size in bytes.
pool: PoolStatsAggregated pool counters.
server: ServerStatsAggregated server counters.
failure: FailureSnapshotAggregated failure-cause metrics.
Implementations§
Source§impl Snapshot
impl Snapshot
Sourcepub fn to_json(&self) -> String
pub fn to_json(&self) -> String
Serialize the snapshot to a JSON string.
The layout is a single JSON object with flat top-level fields followed by a nested pool object containing the per-pool metric counters and a per-server sub-object.
§Examples
use dynomite::stats::{Snapshot, PoolStats, ServerStats};
let mut snap = Snapshot::default();
snap.pool = PoolStats::new("dyn_o_mite");
snap.server = ServerStats::new("redis_local");
let s = snap.to_json();
assert!(s.starts_with('{'));
assert!(s.contains("\"dyn_o_mite\""));Sourcepub fn write_json<W: Write>(&self, w: &mut W) -> Result
pub fn write_json<W: Write>(&self, w: &mut W) -> Result
Render the snapshot as JSON into any fmt::Write sink.
§Examples
use dynomite::stats::Snapshot;
let snap = Snapshot::default();
let mut s = String::new();
snap.write_json(&mut s).expect("writing into String never fails");
assert!(s.starts_with('{'));