Some checks failed
ci/hello Job 'hello' completed
ci/smoke Pipeline 'smoke' success
ci/check Job 'check' completed
ci/clippy Job 'clippy' completed
ci/ci Pipeline 'ci' failure
Content addressable datastore. Allows you to configure a node to store and stream large blobs of data, and retrieve them from any swactor-connected node. Co-authored-by: Zachery Aaron Shores-Chmielewski <zacheryasc@gmail.com> Co-committed-by: Zachery Aaron Shores-Chmielewski <zacheryasc@gmail.com>
16 lines
737 B
Rust
16 lines
737 B
Rust
//! Datastore stats provider for the runtime dashboard.
|
|
//!
|
|
//! The trait returns a pre-serialized JSON string so that `runtime-dashboard`
|
|
//! has no compile-time dependency on `swactor-datastore` (which would create a
|
|
//! circular dependency since `swactor-datastore[node]` depends on us).
|
|
//!
|
|
//! The `swactor-datastore` crate implements this trait in its `node` feature.
|
|
|
|
/// Trait for providing datastore stats to the dashboard.
|
|
///
|
|
/// Implementations capture a point-in-time snapshot as serialized JSON.
|
|
/// The dashboard polls this every ~200ms via SSE.
|
|
pub trait DatastoreStatsProvider: Send + Sync {
|
|
/// Return a JSON-serialized datastore snapshot, or `None` if unavailable.
|
|
fn snapshot_json(&self) -> Option<String>;
|
|
}
|