Sigil documentation
ReferenceRust referencesigil-zk

sigil-zk · metrics

Source declarations, signatures and documentation for metrics.

Source: sigil/node/sigil-zk/src/metrics.rs. SHA-256: adb85f57b78b77df2c3a579d8572587aacc0b34f3eaca1112dfaeae02cbb0bc3.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

metrics::ZkMetrics

Aggregated ZK proof pipeline metrics.

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ZkMetrics {
/// Total number of proofs generated.

pub proofs_generated: u64,
/// Total number of proofs verified.

pub proofs_verified: u64,
/// Average proof generation time in milliseconds.

pub avg_prove_time_ms: f64,
/// Average proof verification time in milliseconds.

pub avg_verify_time_ms: f64,
/// Number of verification failures.

pub verification_failures: u64,
/// Current pipeline depth (number of completed proofs retained).

pub pipeline_depth: usize
}

Source line: 12.

metrics::ZkMetrics::new

Create a new metrics instance with all counters at zero.

pub fn new() -> Self;

Source line: 36.

metrics::ZkMetrics::record_proof_generation

Record a proof generation event.

Updates the running average proof generation time.

pub fn record_proof_generation(&mut self, time_ms: u64);

Source line: 52.

metrics::ZkMetrics::record_verification

Record a proof verification event.

Updates the running average verification time and failure count.

pub fn record_verification(&mut self, time_ms: u64, success: bool);

Source line: 61.

metrics::ZkMetrics::meets_target

Returns true if the average verification time meets the target (<= 10ms).

pub fn meets_target(&self) -> bool;

Source line: 72.

metrics::ZkMetrics::verification_success_rate

Returns the verification success rate as a fraction (0.0 to 1.0).

Returns 1.0 if no verifications have been recorded.

pub fn verification_success_rate(&self) -> f64;

Source line: 79.

On this page