feat: add canonicalization latency metric#3865
Conversation
Rjected
left a comment
There was a problem hiding this comment.
Logic wise this looks great! I wonder if we can do something like the following though:
let start = Instant::now();
let make_canonical_result = self.blockchain.make_canonical(&state.head_block_hash);
self.record_make_canonical_latency(start, make_canonical_result);
let status = match make_canonical_result {
// ... restwhere record_make_canonical_latency does a match:
let elapsed = start.elapsed();
self.metrics.make_canonical_latency.record(elapsed);
match outcome {
Ok(MakeCanonicalOutcome::AlreadyCanonical) => self.metrics.make_canonical_already_canonical_latency.record(elapsed),
// the AlreadyCommitted case
Err(_) => // the err case
}does that make sense? I think then, we don't have to intersperse the metrics record calls in the match for other logic.
|
this also needs to be rebased / merged with the latest main since we made some fixes to CI |
|
Perfect, yes makes sense - I wasn't sure if I should restructure the flow on the main match statement but what you have there makes sense. Will push shortly |
|
@Rjected I put in the changes you asked for - please let me know if the branch looks ok. |
Codecov Report
... and 9 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
cool - just going to clean up the merge a little bit |
5d7c03c to
6a70991
Compare
Closes #3815