pub struct GraphStats {
pub collection: String,
pub node_count: u64,
pub edge_count: u64,
pub distinct_label_count: u64,
pub labels: Vec<(String, u64)>,
}Expand description
Aggregate stats for a single graph collection (or the full edge store when no collection is specified).
Returned by [NodeDb::graph_stats]. Wire-safe: serializes to/from
MessagePack so the value can cross the Data-Plane boundary unchanged.
The node_count field counts distinct node IDs observed as edge
endpoints (not necessarily all nodes ever inserted). For Origin, this
equals distinct_node_count from the persistent stats table; for Lite,
it is derived from the CRDT edge store at query time.
Fields§
§collection: StringName of the collection (or "__edges" on Lite when no collection is
supplied).
node_count: u64Distinct node IDs that appear as an edge source or destination.
edge_count: u64Total number of edges in the collection.
distinct_label_count: u64Number of distinct edge label strings.
labels: Vec<(String, u64)>Per-label edge counts, sorted ascending by label name.
Implementations§
Source§impl GraphStats
impl GraphStats
Sourcepub const EXPECTED_COLUMNS: [&'static str; 5]
pub const EXPECTED_COLUMNS: [&'static str; 5]
Column names of the wire row shape produced by
SHOW GRAPH STATS [<'collection'>]. Single source of truth — the
parser validates against this, and clients use it to build the
columns slice in tests so the two never drift.
pub fn zero(collection: impl Into<String>) -> Self
Sourcepub fn parse_show_stats_response(
columns: &[String],
rows: &[Vec<Value>],
) -> NodeDbResult<Vec<Self>>
pub fn parse_show_stats_response( columns: &[String], rows: &[Vec<Value>], ) -> NodeDbResult<Vec<Self>>
Parse the wire shape produced by SHOW GRAPH STATS [<'collection'>]
into a vec of GraphStats, one entry per row. Used by both the
native and the pgwire remote clients — keeping a single parser here
is what makes the wire_shape: smoke-probe error messages a
meaningful diagnostic rather than a coincidence between two copies.
Expected columns: (collection, node_count, edge_count, distinct_label_count, labels), where labels is a JSON array of
{"label": str, "count": u64} objects.
Both wire paths can deliver count cells as Value::Integer
(extended-query / native typed) or Value::String (pgwire simple
query text protocol); both shapes are accepted.
Column-shape mismatches surface as errors (this is exactly the bug class the smoke probe is designed to trap, so no fallback); empty rows return an empty vec — callers decide how to interpret no rows.
Trait Implementations§
Source§impl Clone for GraphStats
impl Clone for GraphStats
Source§fn clone(&self) -> GraphStats
fn clone(&self) -> GraphStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GraphStats
impl Debug for GraphStats
Source§impl<'de> Deserialize<'de> for GraphStats
impl<'de> Deserialize<'de> for GraphStats
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<'__msgpack_de> FromMessagePack<'__msgpack_de> for GraphStats
impl<'__msgpack_de> FromMessagePack<'__msgpack_de> for GraphStats
Source§impl PartialEq for GraphStats
impl PartialEq for GraphStats
Source§fn eq(&self, other: &GraphStats) -> bool
fn eq(&self, other: &GraphStats) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for GraphStats
impl Serialize for GraphStats
impl StructuralPartialEq for GraphStats
Auto Trait Implementations§
impl Freeze for GraphStats
impl RefUnwindSafe for GraphStats
impl Send for GraphStats
impl Sync for GraphStats
impl Unpin for GraphStats
impl UnsafeUnpin for GraphStats
impl UnwindSafe for GraphStats
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromMessagePackOwned for Twhere
T: for<'a> FromMessagePack<'a>,
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar 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.