Skip to main content

Module upload_stats

Module upload_stats 

Source
Expand description

Reliable, Instant-based upload timing accumulators (profiling builds only).

Async tracing spans cannot measure per-await latency or task concurrency under a multi-threaded runtime — a future’s span fragments across worker threads — so these atomics accumulate real measured durations and byte counts for a trustworthy phase breakdown. Durations are summed across concurrent batches, so totals can exceed wall-clock; (rpc + upload) / wall gives the effective parallelism, and bytes / wall the effective upload bandwidth.

Functions§

reset
Zero all accumulators. Call once before starting an upload.
snapshot
Snapshot of (rpc_nanos, upload_nanos, upload_bytes) accumulated so far.