HomePhabricator

[backport#16805] logs: add timing information to FlushStateToDisk()

Description

[backport#16805] logs: add timing information to FlushStateToDisk()

Summary:
dcef9a2922317cb2849f397366b6c56d755db6c9 logs: add timing information to FlushStateToDisk() (James O'Beirne)
41edaf227a69bc4846d5996675e8763fdfe0f367 logs: add BCLog::Timer and related macros (James O'Beirne)

Pull request description:

It's currently annoying to detect FlushStateToDisk() calls when benchmarking since they have to be inferred from a drop in coins count from the `UpdateTip: ` log messages. This adds a new logging utility, `BCLog::Timer`, and some related macros that are generally useful for printing timing-related logging messages, and a message that is unconditionally written when the coins cache is flushed to disk.

```
2019-09-04T20:17:51Z FlushStateToDisk: write block and undo data to disk completed (3ms)
2019-09-04T20:17:51Z FlushStateToDisk: write block index to disk completed (370ms)
2019-09-04T20:17:51Z FlushStateToDisk: write coins cache to disk (2068451 coins, 294967kB) completed (21481ms)
```

Backport of Core PR16805

Test Plan:

ninja all check check-functional

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D8754

Details

Provenance
Wladimir J. van der Laan <laanwj@protonmail.com>Authored on Nov 5 2019, 22:44
majcostaCommitted on Dec 24 2020, 16:07
majcostaPushed on Dec 24 2020, 16:07
Reviewer
Restricted Project
Differential Revision
D8754: [backport#16805] logs: add timing information to FlushStateToDisk()
Parents
rABC9ca4736e58ae: [backport#17242] refactor: Remove unused cacheSigStore from…
Branches
Unknown
Tags
Unknown