Skip to content

Commit 08a3fe7

Browse files
authored
fix: Fix counter metric type to be Counter. (#3153)
## What ❔ Fix counter metric type to be Counter. <!-- What are the changes this PR brings about? --> <!-- Example: This PR adds a PR template to the repo. --> <!-- (For bigger PRs adding more context is appreciated) --> ## Why ❔ To have correct calculation of network errors across restarts. <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`.
1 parent 35e84cc commit 08a3fe7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

core/bin/zksync_tee_prover/src/metrics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use std::time::Duration;
44

5-
use vise::{Buckets, Gauge, Histogram, Metrics, Unit};
5+
use vise::{Buckets, Counter, Gauge, Histogram, Metrics, Unit};
66

77
#[derive(Debug, Metrics)]
88
#[metrics(prefix = "tee_prover")]
@@ -13,7 +13,7 @@ pub(crate) struct TeeProverMetrics {
1313
pub proof_generation_time: Histogram<Duration>,
1414
#[metrics(buckets = Buckets::LATENCIES, unit = Unit::Seconds)]
1515
pub proof_submitting_time: Histogram<Duration>,
16-
pub network_errors_counter: Gauge<u64>,
16+
pub network_errors_counter: Counter<u64>,
1717
pub last_batch_number_processed: Gauge<u64>,
1818
}
1919

core/bin/zksync_tee_prover/src/tee_prover.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ impl Task for TeeProver {
155155
}
156156
}
157157
Err(err) => {
158-
METRICS.network_errors_counter.inc_by(1);
158+
METRICS.network_errors_counter.inc();
159159
if !err.is_retriable() || retries > config.max_retries {
160160
return Err(err.into());
161161
}

0 commit comments

Comments
 (0)