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('{'));Trait Implementations§
Auto Trait Implementations§
impl Freeze for Snapshot
impl RefUnwindSafe for Snapshot
impl Send for Snapshot
impl Sync for Snapshot
impl Unpin for Snapshot
impl UnsafeUnpin for Snapshot
impl UnwindSafe for Snapshot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.