-
-
Notifications
You must be signed in to change notification settings - Fork 290
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: track epoch transition steps time in metrics #6143
Conversation
Performance Report✔️ no performance regression detected Full benchmark results
|
Definitely not necessary to track every single step. Some functions are extremely cheap to run, just track the ones that do complex expensive logic, look at the benchmarks for reference |
5f6333e
to
bc34818
Compare
@@ -59,19 +65,31 @@ export function processEpoch(fork: ForkSeq, state: CachedBeaconStateAllForks, ca | |||
throw new Error("Lodestar does not support this network, parameters don't fit number value inside state.slashings"); | |||
} | |||
|
|||
let timer = metrics?.epochTransitionStepTime.startTimer({step: "processJustificationAndFinalization"}); |
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.
I don't think it's necessary to use a let here, just declare individual variables. You only need to register labels once
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## unstable #6143 +/- ##
=============================================
+ Coverage 0 90.35% +90.35%
=============================================
Files 0 78 +78
Lines 0 8089 +8089
Branches 0 490 +490
=============================================
+ Hits 0 7309 +7309
- Misses 0 772 +772
- Partials 0 8 +8 |
@@ -59,19 +65,53 @@ export function processEpoch(fork: ForkSeq, state: CachedBeaconStateAllForks, ca | |||
throw new Error("Lodestar does not support this network, parameters don't fit number value inside state.slashings"); | |||
} | |||
|
|||
processJustificationAndFinalization(state, cache); | |||
{ | |||
const timer = metrics?.epochTransitionStepTime.startTimer({ |
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.
would it make sense to have a metric utility function withTimer
which just does the instrumentation? could refactor in a separate PR
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.
yeah, that would be nice
🎉 This PR is included in v1.13.0 🎉 |
Motivation
We have unstable epoch transitions and we have no idea which steps take the most time
Description
part of #6112
part of #6063
part of #5409