Skip to content

Commit

Permalink
feat: Add protocol_version label to WG jobs metric (#2009)
Browse files Browse the repository at this point in the history
## What ❔

Add protocol_version label to WG jobs metric

## Why ❔

To be able to use autoscaler for protocol versions

## 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).
- [x] 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`.
- [x] Spellcheck has been run via `zk spellcheck`.
  • Loading branch information
Artemka374 authored May 22, 2024
1 parent 602bf67 commit e0a3393
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
5 changes: 3 additions & 2 deletions core/node/house_keeper/src/prover/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ impl From<&str> for WitnessType {
pub(crate) struct ServerMetrics {
pub prover_fri_requeued_jobs: Counter<u64>,
pub requeued_jobs: Family<WitnessType, Counter<u64>>,
#[metrics(labels = ["type", "round"])]
pub witness_generator_jobs_by_round: LabeledFamily<(&'static str, String), Gauge<u64>, 2>,
#[metrics(labels = ["type", "round", "protocol_version"])]
pub witness_generator_jobs_by_round:
LabeledFamily<(&'static str, String, String), Gauge<u64>, 3>,
#[metrics(labels = ["type", "protocol_version"])]
pub witness_generator_jobs: LabeledFamily<(&'static str, String), Gauge<u64>, 2>,
pub leaf_fri_witness_generator_waiting_to_queued_jobs_transitions: Counter<u64>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,17 @@ fn emit_metrics_for_round(round: AggregationRound, stats: JobCountStatistics) {
);
}

SERVER_METRICS.witness_generator_jobs_by_round[&("queued", format!("{:?}", round))]
SERVER_METRICS.witness_generator_jobs_by_round[&(
"queued",
format!("{:?}", round),
ProtocolVersionId::current_prover_version().to_string(),
)]
.set(stats.queued as u64);
SERVER_METRICS.witness_generator_jobs_by_round[&("in_progress", format!("{:?}", round))]
SERVER_METRICS.witness_generator_jobs_by_round[&(
"in_progress",
format!("{:?}", round),
ProtocolVersionId::current_prover_version().to_string(),
)]
.set(stats.queued as u64);
}

Expand Down

0 comments on commit e0a3393

Please sign in to comment.