pub struct AttemptMetrics {
pub index: usize,
pub usage: UsageSnapshot,
pub custom_metrics: HashMap<MetricKey, u64>,
pub duration: Option<Duration>,
pub commit_duration: Option<Duration>,
pub on_error_duration: Option<Duration>,
pub outcome: AttemptOutcome,
pub conflicting_keys: ConflictKeys,
pub read_version: Option<i64>,
}Expand description
Everything recorded about a single transaction attempt.
One is pushed to MetricsReport::attempts when the attempt ends, so an
attempt that was retried keeps its own counters, timings and custom metrics
instead of being overwritten by the next one.
Fields§
§index: usizePosition of the attempt in the run, starting at 0.
usage: UsageSnapshotOperation counters and bytes of the attempt, from the always-on
accounting. See crate::budget for how precise they are.
custom_metrics: HashMap<MetricKey, u64>Application metrics recorded during the attempt with
Transaction::set_custom_metric.
duration: Option<Duration>Wall clock of the attempt, measured from its start to the end of its
work: the retry backoff performed by on_error is not included.
commit_duration: Option<Duration>Time spent in commit, None if the attempt never reached it.
on_error_duration: Option<Duration>Time spent in on_error, backoff included. None if on_error did not
run, which is the case for the last attempt of a run.
outcome: AttemptOutcomeHow the attempt ended.
conflicting_keys: ConflictKeysConflicting key ranges, only read after a commit conflict.
read_version: Option<i64>Read version of the attempt, recorded when
Transaction::get_read_version
is called. The binding never fetches it on its own.
Trait Implementations§
Source§impl Clone for AttemptMetrics
impl Clone for AttemptMetrics
Source§fn clone(&self) -> AttemptMetrics
fn clone(&self) -> AttemptMetrics
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more