-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Add bloom filter usage statistics #7685
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
Conversation
5e39d26 to
6dfbf4d
Compare
|
Yes, would be interesting to keep track of some statistics regarding resource usage. |
|
Concept ACK. Is this pure coincidence? |
src/net.h
Outdated
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.
Please remove primitives/block.h from the network layer. Compute the size of the block in main.cpp and pass the size instead of the block itself into FilterStatsProcessBlock().
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 have also thought about this during the time of writing the code. I think its more flexible the way it is now. FilterStatsProcessBlock could also count transactions or the total amount of vins/vouts per block (which is basically where the filter needs to "go through").
Including block.h should be not a problem.
|
@paveljanik: there was a bug in a previous pushed commit that mixed-up I have tested this PR now on a mainnet node and it seems to work good. |
|
Rebase needed. |
69cd4b2 to
73e8d32
Compare
|
Rebased. |
|
Commit message 971e3e4bdf39ff2d13f3aee73e4b8086bc235120: cytle -> cycle Needs tests and maybe some text to be included in the release notes (low prio IMO, because this is a low level stuff - or -help-debug?). |
|
Needs rebase and nits addressed. |
73e8d32 to
f17c996
Compare
|
Still needs a rebase. |
304dcc1 to
8ceb743
Compare
|
Rebased. |
|
Needs rebase. |
8ceb743 to
5005595
Compare
|
Rebased. This is something that could be integrated into the general stats collector approach (#8501). |
|
Closing because of inactivity. |
It can be useful to know, how many blocks and how many times the mempool was filtered.
Bloom filtering is CPU intense and thus informations about its usage can help to identify sources of resource consumption.
Collecting statistics would be required to dynamic limit the amount of accepted bloom filtering.
This PR does only collect global statistics (total value and value per timeframe of currently 1h), though, I kept the design flexible. Extending this to per-node bloom-filter statistics is possible.
Also the time consumption in milliseconds for all filter processes will be collected, although, this value depends on your system workload and might not be very representative.
Statistics can be printed with the new RPC command
getfilterstats.Example: