Skip to main content

record_performance

Function record_performance 

Source
pub fn record_performance(transaction_name: &str, duration_ms: f64)
Expand description

Records one timed call’s duration, in milliseconds, under transaction_name: tallied in-process (count, total, max) and flushed periodically as one small aggregate report, for the Performance page’s per-transaction table, not one network call per call. A no-op when Configuration.track_performance is false or reporting isn’t enabled for this environment.

This crate has no web framework integration of its own (unlike sdks/go’s net/http/Gin middleware), so nothing is timed automatically: wrap whatever you want on the Performance page yourself, e.g. a request handler, with time_transaction, or call this directly with a duration you measured. Keep transaction_name low-cardinality ("GET /users/:id", not "GET /users/42"): every distinct name is its own row.