-
Notifications
You must be signed in to change notification settings - Fork 48
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
chore: add more metrics for perf #66
chore: add more metrics for perf #66
Conversation
8b3e0cd
to
70fa92a
Compare
70fa92a
to
26dd775
Compare
triehash := statedb.AccountHashes + statedb.StorageHashes // The time spent on tries hashing | ||
trieUpdate := statedb.AccountUpdates + statedb.StorageUpdates // The time spent on tries update | ||
trieRead := statedb.SnapshotAccountReads + statedb.AccountReads // The time spent on account read | ||
trieRead += statedb.SnapshotStorageReads + statedb.StorageReads // The time spent on storage read | ||
blockExecutionTimer.Update(ptime - trieRead) // The time spent on EVM processing | ||
blockValidationTimer.Update(vtime - (triehash + trieUpdate)) // The time spent on block validation | ||
blockExecutionTimer.Update(ptime) // The time spent on EVM processing | ||
blockValidationTimer.Update(vtime) // The time spent on block validation |
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.
It seems that the definitions of blockExecutionTimer
and blockValidationTimer
have been re-defined. While I am not sure if this is intended. if yes, could you please explain why this change is better?
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.
Yes; this PR does not delete any metrics, but only adjusts the calculation method of metrics, because when analyzing performance bottlenecks during --metrics.expensive
, blockExecutionTimer/blockValidationTimer/blockWriteTimer may be negative when deducting concurrency latency. This is a bit confusing. In fact, if we pay attention to the metrics of internal concurrent/async actions, we can directly configure a corresponding panel, and I think it is better to have clear semantics of blockExecutionTimer/blockValidationTimer/blockWriteTimer. :)
This is just a slight change and ultimately depends on the reviewers' suggestions.
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.
If without --metrics.expensive
, These triehash/trieUpdate/..Commits
are all equal to 0.
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.
ACK. Thanks.
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.
LGTM
fmt.Printf("loop print db stats db_metrics=\n%v\n", stats) | ||
d.log.Info("loop print db stats", "comp_time", compTime, "write_delay_count", writeDelayCount, "write_delay_time", | ||
writeDelayTime, "non_level0_comp_count", nonLevel0CompCount, "level0_comp_count", level0CompCount) |
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 noticed that the log level is info, will it result to log explosion
Close this PR since most of the metrics have been added in #71 |
Description
Add more metrics for perf.
Rationale
N/A.
Example
--metrics.expensive
enable more metrics for perf.Changes
Notable changes: