mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-19 03:04:27 -05:00
feat(engine): add time_between_new_payloads metric (#21158)
This commit is contained in:
committed by
GitHub
parent
d5dc0b27eb
commit
27e055f790
@@ -298,6 +298,8 @@ pub(crate) struct NewPayloadStatusMetrics {
|
||||
pub(crate) new_payload_latency: Histogram,
|
||||
/// Latency for the last new payload call.
|
||||
pub(crate) new_payload_last: Gauge,
|
||||
/// Time between consecutive new payload calls (payload-to-payload interval).
|
||||
pub(crate) time_between_new_payloads: Histogram,
|
||||
}
|
||||
|
||||
impl NewPayloadStatusMetrics {
|
||||
@@ -311,6 +313,9 @@ impl NewPayloadStatusMetrics {
|
||||
let finish = Instant::now();
|
||||
let elapsed = finish - start;
|
||||
|
||||
if let Some(prev) = self.latest_at {
|
||||
self.time_between_new_payloads.record(start - prev);
|
||||
}
|
||||
self.latest_at = Some(finish);
|
||||
match result {
|
||||
Ok(outcome) => match outcome.outcome.status {
|
||||
|
||||
Reference in New Issue
Block a user