Skip to content

Commit

Permalink
fix: Fix counter metric type to be Counter. (#3153)
Browse files Browse the repository at this point in the history
## 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`.
  • Loading branch information
yorik authored Oct 23, 2024
1 parent 35e84cc commit 08a3fe7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/bin/zksync_tee_prover/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use std::time::Duration;

use vise::{Buckets, Gauge, Histogram, Metrics, Unit};
use vise::{Buckets, Counter, Gauge, Histogram, Metrics, Unit};

#[derive(Debug, Metrics)]
#[metrics(prefix = "tee_prover")]
Expand All @@ -13,7 +13,7 @@ pub(crate) struct TeeProverMetrics {
pub proof_generation_time: Histogram<Duration>,
#[metrics(buckets = Buckets::LATENCIES, unit = Unit::Seconds)]
pub proof_submitting_time: Histogram<Duration>,
pub network_errors_counter: Gauge<u64>,
pub network_errors_counter: Counter<u64>,
pub last_batch_number_processed: Gauge<u64>,
}

Expand Down
2 changes: 1 addition & 1 deletion core/bin/zksync_tee_prover/src/tee_prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ impl Task for TeeProver {
}
}
Err(err) => {
METRICS.network_errors_counter.inc_by(1);
METRICS.network_errors_counter.inc();
if !err.is_retriable() || retries > config.max_retries {
return Err(err.into());
}
Expand Down

0 comments on commit 08a3fe7

Please sign in to comment.