Repository navigation
Conversation
|
I've successfully deployed and tested the new Current Metrics from Nodegetmemoryinfo (6 metrics): getaddrmaninfo (18 metrics):
By network:
|
| // A getmemoryinfo RPC result: Returns information about memory usage. | ||
| message MemoryInfo { | ||
| required LockedMemory locked = 1; // Information about locked memory manager | ||
| } | ||
|
|
||
| // Locked memory manager information. Part of getmemoryinfo. | ||
| message LockedMemory { | ||
| required uint64 used = 1; // Number of bytes used | ||
| required uint64 free = 2; // Number of bytes available in current arenas | ||
| required uint64 total = 3; // Total number of bytes managed | ||
| required uint64 locked = 4; // Amount of bytes that succeeded locking | ||
| required uint64 chunks_used = 5; // Number of allocated chunks | ||
| required uint64 chunks_free = 6; // Number of unused chunks | ||
| } |
There was a problem hiding this comment.
Can simplify this, no need for the additional locked step:
| // A getmemoryinfo RPC result: Returns information about memory usage. | |
| message MemoryInfo { | |
| required LockedMemory locked = 1; // Information about locked memory manager | |
| } | |
| // Locked memory manager information. Part of getmemoryinfo. | |
| message LockedMemory { | |
| required uint64 used = 1; // Number of bytes used | |
| required uint64 free = 2; // Number of bytes available in current arenas | |
| required uint64 total = 3; // Total number of bytes managed | |
| required uint64 locked = 4; // Amount of bytes that succeeded locking | |
| required uint64 chunks_used = 5; // Number of allocated chunks | |
| required uint64 chunks_free = 6; // Number of unused chunks | |
| } | |
| // A getmemoryinfo RPC result: Returns information about memory usage. | |
| message MemoryInfo { | |
| required uint64 used = 1; // Number of bytes used | |
| required uint64 free = 2; // Number of bytes available in current arenas | |
| required uint64 total = 3; // Total number of bytes managed | |
| required uint64 locked = 4; // Amount of bytes that succeeded locking | |
| required uint64 chunks_used = 5; // Number of allocated chunks | |
| required uint64 chunks_free = 6; // Number of unused chunks | |
| } |
| fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | ||
| write!( | ||
| f, | ||
| "LockedMemory(used={}B, total={}B, locked={}B)", |
There was a problem hiding this comment.
| "LockedMemory(used={}B, total={}B, locked={}B)", | |
| "MemoryInfo(used={}B, total={}B, locked={}B)", |
| pub rpc_addrmaninfo_ipv4_new: IntGauge, | ||
| pub rpc_addrmaninfo_ipv4_tried: IntGauge, | ||
| pub rpc_addrmaninfo_ipv4_total: IntGauge, | ||
| pub rpc_addrmaninfo_ipv6_new: IntGauge, | ||
| pub rpc_addrmaninfo_ipv6_tried: IntGauge, | ||
| pub rpc_addrmaninfo_ipv6_total: IntGauge, | ||
| pub rpc_addrmaninfo_onion_new: IntGauge, | ||
| pub rpc_addrmaninfo_onion_tried: IntGauge, | ||
| pub rpc_addrmaninfo_onion_total: IntGauge, | ||
| pub rpc_addrmaninfo_i2p_new: IntGauge, | ||
| pub rpc_addrmaninfo_i2p_tried: IntGauge, | ||
| pub rpc_addrmaninfo_i2p_total: IntGauge, | ||
| pub rpc_addrmaninfo_cjdns_new: IntGauge, | ||
| pub rpc_addrmaninfo_cjdns_tried: IntGauge, | ||
| pub rpc_addrmaninfo_cjdns_total: IntGauge, | ||
| pub rpc_addrmaninfo_all_new: IntGauge, | ||
| pub rpc_addrmaninfo_all_tried: IntGauge, | ||
| pub rpc_addrmaninfo_all_total: IntGauge, |
There was a problem hiding this comment.
instead of duplicating this, we should just use a pub rpc_addrmaninfo: IntGaugeVec and have the labels be network (ipv4, ipv6, ...) and type (new, tried, total).
There was a problem hiding this comment.
good idea, 'll work on this
|
Thanks for the thorough review @0xB10C! I've implemented all the suggested improvements: 1. Flattened Protobuf Structure
2. Optimized Metrics with IntGaugeVec
3. Updated Tests
All CI checks passing locally. Ready for review! |
deadmanoz
left a comment
There was a problem hiding this comment.
Some comments on minor changes.
|
Updated test assertion as requested, thanks both for the feedback! |
009142d to
d04e396
Compare
0xB10C
left a comment
There was a problem hiding this comment.
Squashed the commits and added two metrics tests: test_integration_metrics_rpc_getmemoryinfo and test_integration_metrics_rpc_getaddrmaninfo.
Looks good to me now.
|
|
||
| ## Supported RPCs | ||
|
|
||
| The `rpc-extractor` currently supports the following Bitcoin Core RPC methods: | ||
|
|
||
| - **`getpeerinfo`**: Information about each connected peer | ||
| - **`getmempoolinfo`**: Details on the active state of the TX memory pool | ||
| - **`uptime`**: Node uptime in seconds | ||
| - **`getnettotals`**: Information about network traffic (bytes in/out) | ||
| - **`getmemoryinfo`**: Information about memory usage (locked memory statistics) | ||
|
|
||
| Each RPC can be individually disabled using the corresponding `--disable-*` flag. |
There was a problem hiding this comment.
I think this is good to have, but maybe in a separate PR. Maybe when we close #199.
|
|
Again, thank you @GuiSchet! |
Add RPC extractors for getmemoryinfo and getaddrmaninfo
Implements support for two new Bitcoin Core RPC methods in the rpc-extractor, listed on #199
Changes
Extracts memory usage statistics from Bitcoin Core:
Extracts address manager statistics from Bitcoin Core (requires Bitcoin Core v26+):
all_networks):
Modified Files
Protobuf schema:
Shared library:
RPC Extractor:
Metrics tool:
Testing
All tests pass successfully:
Both RPCs can be individually disabled using --disable-getmemoryinfo and --disable-getaddrmaninfo flags.