Skip to content
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

Conversation

will-2012
Copy link
Contributor

@will-2012 will-2012 commented Mar 5, 2024

Description

Add more metrics for perf.

Rationale

N/A.

Example

--metrics.expensive enable more metrics for perf.

Changes

Notable changes:

  • N/A.

@will-2012 will-2012 force-pushed the add-more-metrics branch 2 times, most recently from 8b3e0cd to 70fa92a Compare March 6, 2024 02:17
Comment on lines -1885 to +1888
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
Copy link
Contributor

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?

Copy link
Contributor Author

@will-2012 will-2012 Mar 6, 2024

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.

Copy link
Contributor Author

@will-2012 will-2012 Mar 6, 2024

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK. Thanks.

@will-2012 will-2012 requested a review from bendanzhentan March 6, 2024 12:47
Copy link
Contributor

@bendanzhentan bendanzhentan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +497 to +499
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)
Copy link
Contributor

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

@owen-reorg
Copy link
Collaborator

Close this PR since most of the metrics have been added in #71

@owen-reorg owen-reorg closed this Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants