log: improve checkaddrman logging with duration in milliseconds#22872
Closed
jonatack wants to merge 3 commits into
Closed
log: improve checkaddrman logging with duration in milliseconds#22872jonatack wants to merge 3 commits into
jonatack wants to merge 3 commits into
Conversation
maflcko
reviewed
Sep 3, 2021
Contributor
|
Concept ACK |
2 similar comments
Contributor
|
Concept ACK |
Member
|
Concept ACK |
0b2d839 to
b3b4a92
Compare
maflcko
reviewed
Sep 10, 2021
Contributor
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
This was referenced Sep 11, 2021
b3b4a92 to
3e23496
Compare
Closed
3e23496 to
8112122
Compare
8112122 to
ce97db1
Compare
Member
Author
This was referenced Sep 22, 2021
maflcko
reviewed
Sep 24, 2021
Member
There was a problem hiding this comment.
unrelated idea:
The following log could also be improved with this new macro:
src/validation.cpp: LogPrintf("[snapshot] flushing coins cache (%.2f MB)... ", /* Continued */
Member
There was a problem hiding this comment.
@jonatack Let me know if you want to work on this, otherwise I might pick it up
Member
Author
There was a problem hiding this comment.
Thanks Marco, will have a look and comment here.
Member
Author
There was a problem hiding this comment.
Oh, thanks for the ping!
ce97db1 to
1920f63
Compare
Member
Author
|
Rebased. |
that prints the descriptive message when logging the start but not when logging the completion.
and update the function name to CheckAddrman (drop "Force") for nicer log output as it is prefixed to each of these log messages: 2021-09-21T18:42:50Z [opencon] CheckAddrman: new 64864, tried 1690, total 66554 started 2021-09-21T18:42:50Z [opencon] CheckAddrman: completed (76.21ms) The existing Doxygen documentation on the function already makes clear that it is unaffected by m_consistency_check_ratio.
1920f63 to
22b44fc
Compare
Member
Author
|
Rebased! |
Member
|
Code review ACK 22b44fc |
maflcko
pushed a commit
to bitcoin-core/gui
that referenced
this pull request
Nov 10, 2021
…uration in milliseconds 22b44fc p2p: improve checkaddrman logging with duration in milliseconds (Jon Atack) ec65bed log, timer: add LOG_TIME_MILLIS_WITH_CATEGORY_MSG_ONCE macro (Jon Atack) 325da75 log, timer: allow not repeating log message on completion (Jon Atack) Pull request description: This patch: - updates the `logging/timer.h::Timer` class to allow not repeating the log message on completion - adds a `LOG_TIME_MILLIS_WITH_CATEGORY_MSG_ONCE` macro that prints the descriptive message when logging the start but not when logging the completion - updates the checkaddrman logging to log the duration, and renames the function like the `-checkaddrman` configuration option in order to prefix every log message with `CheckAddrman` instead of the longer, less pleasant, and different-from-checkaddrman `ForceCheckAddrman` (the Doxygen documentation on the function already makes clear that it is unaffected by `m_consistency_check_ratio`). before ``` 2021-09-21T18:42:50Z [opencon] Addrman checks started: new 64864, tried 1690, total 66554 2021-09-21T18:42:50Z [opencon] Addrman checks completed successfully ``` after ``` 2021-09-21T18:42:50Z [opencon] CheckAddrman: new 64864, tried 1690, total 66554 started 2021-09-21T18:42:50Z [opencon] CheckAddrman: completed (76.21ms) ``` To test, build and run bitcoind with `-debug=addrman -checkaddrman=<n>` for a value of `n` in the range of, say, 10 to 40. ACKs for top commit: laanwj: Code review ACK 22b44fc Tree-SHA512: 658c0dfaaa9d07092e2418f2d05007c58cc35be6593f22b3c592ce793334a885dd92dacc46bdeddc9d37939cf11174660a094c07c0fa117fbb282953aa45a94d
Member
|
Merged |
sidhujag
pushed a commit
to syscoin/syscoin
that referenced
this pull request
Nov 10, 2021
…in milliseconds 22b44fc p2p: improve checkaddrman logging with duration in milliseconds (Jon Atack) ec65bed log, timer: add LOG_TIME_MILLIS_WITH_CATEGORY_MSG_ONCE macro (Jon Atack) 325da75 log, timer: allow not repeating log message on completion (Jon Atack) Pull request description: This patch: - updates the `logging/timer.h::Timer` class to allow not repeating the log message on completion - adds a `LOG_TIME_MILLIS_WITH_CATEGORY_MSG_ONCE` macro that prints the descriptive message when logging the start but not when logging the completion - updates the checkaddrman logging to log the duration, and renames the function like the `-checkaddrman` configuration option in order to prefix every log message with `CheckAddrman` instead of the longer, less pleasant, and different-from-checkaddrman `ForceCheckAddrman` (the Doxygen documentation on the function already makes clear that it is unaffected by `m_consistency_check_ratio`). before ``` 2021-09-21T18:42:50Z [opencon] Addrman checks started: new 64864, tried 1690, total 66554 2021-09-21T18:42:50Z [opencon] Addrman checks completed successfully ``` after ``` 2021-09-21T18:42:50Z [opencon] CheckAddrman: new 64864, tried 1690, total 66554 started 2021-09-21T18:42:50Z [opencon] CheckAddrman: completed (76.21ms) ``` To test, build and run bitcoind with `-debug=addrman -checkaddrman=<n>` for a value of `n` in the range of, say, 10 to 40. ACKs for top commit: laanwj: Code review ACK 22b44fc Tree-SHA512: 658c0dfaaa9d07092e2418f2d05007c58cc35be6593f22b3c592ce793334a885dd92dacc46bdeddc9d37939cf11174660a094c07c0fa117fbb282953aa45a94d
maflcko
pushed a commit
to bitcoin-core/gui
that referenced
this pull request
Dec 13, 2021
…nstateManager snapshot persistance 50209a4 validation, doc: remove TODO comment (Jon Atack) 8e37fa8 validation, log: improve logging in FlushSnapshotToDisk() (Jon Atack) 271252c validation, log: extract FlushSnapshotToDisk() function (Jon Atack) Pull request description: Use the `LOG_TIME_MILLIS_WITH_CATEGORY_MSG_ONCE` macro to improve the logging of ChainstateManager snapshot persistance, log task start and completion separately and no longer manually track the duration, as suggested by Marco Falke in bitcoin/bitcoin#22872 (comment). Extract the flushing into one function, which clarifies the logic, extends the improved logging to both flushing call sites, and allows logging the prefix `FlushSnapshotToDisk`, which is similar to `FlushStateToDisk`. before ``` [snapshot] flushing coins cache (0 MB)... done (0.00ms) [snapshot] flushing snapshot chainstate to disk ``` after ``` FlushSnapshotToDisk: flushing coins cache (0 MB) started ... FlushSnapshotToDisk: completed (0.00ms) FlushSnapshotToDisk: saving snapshot chainstate (0 MB) started ... FlushSnapshotToDisk: completed (0.00ms) ``` The logging can be observed in the output of ``` ./src/test/test_bitcoin -t validation_chainstate_tests -- DEBUG_LOG_OUT ``` Top commit has no ACKs. Tree-SHA512: 5d954cd8c7455f8625152a43663a237f04717bb834aed62925a56e17c711fca6ccfc03783970b6b0bde44f64617d804b423a7048287c06ee816db36247acf272
sidhujag
pushed a commit
to syscoin/syscoin
that referenced
this pull request
Dec 13, 2021
…nager snapshot persistance 50209a4 validation, doc: remove TODO comment (Jon Atack) 8e37fa8 validation, log: improve logging in FlushSnapshotToDisk() (Jon Atack) 271252c validation, log: extract FlushSnapshotToDisk() function (Jon Atack) Pull request description: Use the `LOG_TIME_MILLIS_WITH_CATEGORY_MSG_ONCE` macro to improve the logging of ChainstateManager snapshot persistance, log task start and completion separately and no longer manually track the duration, as suggested by Marco Falke in bitcoin#22872 (comment). Extract the flushing into one function, which clarifies the logic, extends the improved logging to both flushing call sites, and allows logging the prefix `FlushSnapshotToDisk`, which is similar to `FlushStateToDisk`. before ``` [snapshot] flushing coins cache (0 MB)... done (0.00ms) [snapshot] flushing snapshot chainstate to disk ``` after ``` FlushSnapshotToDisk: flushing coins cache (0 MB) started ... FlushSnapshotToDisk: completed (0.00ms) FlushSnapshotToDisk: saving snapshot chainstate (0 MB) started ... FlushSnapshotToDisk: completed (0.00ms) ``` The logging can be observed in the output of ``` ./src/test/test_bitcoin -t validation_chainstate_tests -- DEBUG_LOG_OUT ``` Top commit has no ACKs. Tree-SHA512: 5d954cd8c7455f8625152a43663a237f04717bb834aed62925a56e17c711fca6ccfc03783970b6b0bde44f64617d804b423a7048287c06ee816db36247acf272
Fabcien
pushed a commit
to Bitcoin-ABC/bitcoin-abc
that referenced
this pull request
Nov 11, 2022
Summary: > log, timer: allow not repeating log message on completion > log, timer: add LOG_TIME_MILLIS_WITH_CATEGORY_MSG_ONCE macro > > that prints the descriptive message when logging the start > but not when logging the completion. > p2p: improve checkaddrman logging with duration in milliseconds > > and update the function name to CheckAddrman (drop "Force") for > nicer log output as it is prefixed to each of these log messages: > > 2021-09-21T18:42:50Z [opencon] CheckAddrman: new 64864, tried 1690, total 66554 started > 2021-09-21T18:42:50Z [opencon] CheckAddrman: completed (76.21ms) > > The existing Doxygen documentation on the function already makes > clear that it is unaffected by m_consistency_check_ratio. > This is a backport of [[bitcoin/bitcoin#22872 | core#22872]] Test Plan: `ninja all check-all` `src/bitcoind -debug=addrman -checkaddrman=10` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D12469
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch:
logging/timer.h::Timerclass to allow not repeating the log message on completionLOG_TIME_MILLIS_WITH_CATEGORY_MSG_ONCEmacro that prints the descriptive message when logging the start but not when logging the completion-checkaddrmanconfiguration option in order to prefix every log message withCheckAddrmaninstead of the longer, less pleasant, and different-from-checkaddrmanForceCheckAddrman(the Doxygen documentation on the function already makes clear that it is unaffected bym_consistency_check_ratio).before
after
To test, build and run bitcoind with
-debug=addrman -checkaddrman=<n>for a value ofnin the range of, say, 10 to 40.