Fixed sync target detection (#11817)

* Fixed sync target detection

* Always report sync_target metric

* Clamp median across all peers
This commit is contained in:
Arkadiy Paronyan
2022-07-15 13:55:18 +02:00
committed by GitHub
parent ed346d97c5
commit 74f0f45bb1
2 changed files with 11 additions and 5 deletions
+4 -3
View File
@@ -298,9 +298,10 @@ impl MetricsService {
UniqueSaturatedInto::<u64>::unique_saturated_into(num)
});
if let Some(best_seen_block) = best_seen_block {
metrics.block_height.with_label_values(&["sync_target"]).set(best_seen_block);
}
metrics
.block_height
.with_label_values(&["sync_target"])
.set(best_seen_block.unwrap_or(best_number));
}
}
}