-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into popzxc-version-with-git-commit
- Loading branch information
Showing
28 changed files
with
624 additions
and
348 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
use std::time::Duration; | ||
|
||
use vise::{Buckets, EncodeLabelSet, EncodeLabelValue, Family, Histogram, Metrics, Unit}; | ||
|
||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, EncodeLabelValue, EncodeLabelSet)] | ||
#[metrics(label = "stage", rename_all = "snake_case")] | ||
pub(super) enum SnapshotStage { | ||
BatchHeader, | ||
ProtectiveReads, | ||
TouchedSlots, | ||
PreviousValues, | ||
InitialWrites, | ||
Bytecodes, | ||
} | ||
|
||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, EncodeLabelValue, EncodeLabelSet)] | ||
#[metrics(label = "kind", rename_all = "snake_case")] | ||
pub(super) enum AccessKind { | ||
ReadValue, | ||
IsWriteInitial, | ||
LoadFactoryDep, | ||
GetEnumerationIndex, | ||
} | ||
|
||
#[derive(Debug, Metrics)] | ||
#[metrics(prefix = "state_snapshot")] | ||
pub(super) struct SnapshotMetrics { | ||
/// Latency of loading a batch snapshot split by stage. | ||
#[metrics(buckets = Buckets::LATENCIES, unit = Unit::Seconds)] | ||
pub load_latency: Family<SnapshotStage, Histogram<Duration>>, | ||
/// Latency of accessing the fallback storage for a batch snapshot. | ||
#[metrics(buckets = Buckets::LATENCIES, unit = Unit::Seconds)] | ||
pub fallback_access_latency: Family<AccessKind, Histogram<Duration>>, | ||
} | ||
|
||
#[vise::register] | ||
pub(super) static SNAPSHOT_METRICS: vise::Global<SnapshotMetrics> = vise::Global::new(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.