Skip to content

Commit

Permalink
fix(collator): report 0 to metrics when all accounts gone from isolat…
Browse files Browse the repository at this point in the history
…ed partitions
  • Loading branch information
SmaGMan authored and drmick committed Feb 4, 2025
1 parent 6603512 commit a141287
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions collator/src/collator/messages_reader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,13 +440,19 @@ impl MessagesReader {

// metrics: accounts count in isolated partitions
{
for (par_id, count) in queue_diff_with_msgs.partition_router.partitions_stats() {
let partitions_stats = queue_diff_with_msgs.partition_router.partitions_stats();
for par_id in self
.internals_partition_readers
.keys()
.filter(|&&par_id| par_id > 0)
{
let count = partitions_stats.get(par_id).copied().unwrap_or_default();
let labels = [
("workchain", self.for_shard_id.workchain().to_string()),
("par_id", par_id.to_string()),
];
metrics::gauge!("tycho_do_collate_accounts_count_in_partitions", &labels)
.set(*count as f64);
.set(count as f64);
}
}

Expand Down

0 comments on commit a141287

Please sign in to comment.