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

feat: iavl, db & disk stats logging #352

Merged
merged 4 commits into from
Oct 22, 2021
Merged

Conversation

iproudhon
Copy link
Contributor

Added iavl, db & disk stats logging when IAVL_DEV environment variable is set to the device name to check the disk io activity.

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@iproudhon iproudhon self-assigned this Oct 19, 2021
baseapp/abci.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 21, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main@49410af). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #352   +/-   ##
=======================================
  Coverage        ?   53.12%           
=======================================
  Files           ?      643           
  Lines           ?    67322           
  Branches        ?        0           
=======================================
  Hits            ?    35768           
  Misses          ?    28608           
  Partials        ?     2946           

Copy link

@egonspace egonspace left a comment

Choose a reason for hiding this comment

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

.

@egonspace egonspace self-requested a review October 21, 2021 07:57
@egonspace
Copy link

Wouldn't it affect performance to open and parse the file every commit? How about to create a config for turning it off and turning it on?

@iproudhon
Copy link
Contributor Author

iproudhon commented Oct 21, 2021

Wouldn't it affect performance to open and parse the file every commit? How about to create a config for turning it off and turning it on?

It's just string pointer comparisons. If it's uninitialized, i.e. logIoDev == nil, then it checks environment variable once and only once. It's very likely it's disabled all the time, that's why "if logIoDev == &logIoDevNop" is the first line, so that it's just one if condition check most of the cases.

if logIoDev == &logIoDevNop {
// disabled
} else if logIoDev == nil {
// uninitialized, check env. var.
} else {
// enabled, *logIoDev is set to device name to collect data
}

@egonspace
Copy link

It only works when IAVL_DEV is set. I missed this.

Copy link

@egonspace egonspace left a comment

Choose a reason for hiding this comment

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

LGTM

@iproudhon iproudhon merged commit ae8b167 into main Oct 22, 2021
@iproudhon iproudhon deleted the iproudhon/io-stats-logging branch October 22, 2021 23:10
@zemyblue zemyblue mentioned this pull request Jan 26, 2022
5 tasks
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