pub struct IpfrsMetrics {Show 21 fields
pub registry: Registry,
pub blocks_added: Counter,
pub blocks_fetched: Counter,
pub blocks_deleted: Counter,
pub block_add_bytes: Counter,
pub block_fetch_latency: Histogram,
pub cache_hit_rate: Gauge,
pub dht_provide_calls: Counter,
pub dht_find_providers_calls: Counter,
pub dht_provider_records: Gauge,
pub inference_sessions_started: Counter,
pub inference_sessions_completed: Counter,
pub inference_session_latency: Histogram,
pub proof_tree_depth: Histogram,
pub gossipsub_messages_sent: Counter,
pub gossipsub_messages_received: Counter,
pub gossipsub_mesh_peers: Gauge,
pub storage_bytes_total: Gauge,
pub storage_blocks_total: Gauge,
pub gc_runs: Counter,
pub gc_blocks_collected: Counter,
}Expand description
Global metrics registry for IPFRS.
Each field is a Prometheus primitive registered in a private registry so that multiple instances (e.g., in tests) do not conflict with each other.
use ipfrs_interface::metrics::IpfrsMetrics;
let m = IpfrsMetrics::new().expect("failed to create metrics registry");
m.blocks_added.inc();
let text = m.render();
assert!(text.contains("ipfrs_blocks_added_total"));Fields§
§registry: RegistryPrivate registry — metrics exported via render().
blocks_added: CounterTotal blocks added to local storage.
blocks_fetched: CounterTotal blocks fetched from local storage or network.
blocks_deleted: CounterTotal blocks deleted.
block_add_bytes: CounterTotal bytes written via add_bytes / add_file.
block_fetch_latency: HistogramLatency (seconds) for block fetch operations.
cache_hit_rate: GaugeRolling cache hit-rate (0.0 – 1.0).
dht_provide_calls: CounterNumber of DHT provide calls.
dht_find_providers_calls: CounterNumber of DHT find_providers calls.
dht_provider_records: GaugeCurrent number of provider records held by this node.
inference_sessions_started: CounterInference sessions started.
inference_sessions_completed: CounterInference sessions completed successfully.
inference_session_latency: HistogramEnd-to-end latency (seconds) for completed inference sessions.
proof_tree_depth: HistogramDepth of proof trees emitted during inference.
gossipsub_messages_sent: CounterMessages published to GossipSub topics.
gossipsub_messages_received: CounterMessages received from GossipSub topics.
gossipsub_mesh_peers: GaugeCurrent number of mesh peers across all topics.
storage_bytes_total: GaugeTotal bytes currently stored on disk (updated periodically).
storage_blocks_total: GaugeTotal number of blocks currently stored on disk.
gc_runs: CounterNumber of GC runs completed.
gc_blocks_collected: CounterTotal blocks collected (deleted) across all GC runs.
Implementations§
Source§impl IpfrsMetrics
impl IpfrsMetrics
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for IpfrsMetrics
impl !UnwindSafe for IpfrsMetrics
impl Freeze for IpfrsMetrics
impl Send for IpfrsMetrics
impl Sync for IpfrsMetrics
impl Unpin for IpfrsMetrics
impl UnsafeUnpin for IpfrsMetrics
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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.