forked from matter-labs/zksync-era
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add metric to CallTracer for calculating maximum depth of the c…
…alls (matter-labs#535) ## What ❔ Add metric to CallTracer for calculating maximum depth of the calls ## Why ❔ We need to know what our limits are. ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `zk fmt` and `zk lint`.
- Loading branch information
1 parent
c594323
commit 19c84ce
Showing
5 changed files
with
77 additions
and
30 deletions.
There are no files selected for viewing
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,15 @@ | ||
use vise::{Buckets, Histogram, Metrics}; | ||
|
||
#[derive(Debug, Metrics)] | ||
#[metrics(prefix = "vm_call_tracer")] | ||
pub struct CallMetrics { | ||
/// Maximum call stack depth during the execution of the transaction. | ||
#[metrics(buckets = Buckets::exponential(1.0..=64.0, 2.0))] | ||
pub call_stack_depth: Histogram<usize>, | ||
/// Maximum number of near calls during the execution of the transaction. | ||
#[metrics(buckets = Buckets::exponential(1.0..=64.0, 2.0))] | ||
pub max_near_calls: Histogram<usize>, | ||
} | ||
|
||
#[vise::register] | ||
pub static CALL_METRICS: vise::Global<CallMetrics> = 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
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