-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add canonicalization latency metric #3865
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 {
// ... rest
where 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great work - thank you!
Closes #3815