Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add get-db-stats command (#3274)
Description --- Adds `get-db-stats` command. This returns the LMDB entry stats and the total entry sizes for each internal blockchain db. Motivation and Context --- Useful in debugging database sizes. At height 26215 ``` >> get-db-stats Name | Entries | Depth | Branch Pages | Leaf Pages | Overflow Pages --------------------------------- | ------- | ----- | ------------ | ---------- | -------------- metadata_db | 5 | 1 | 0 | 1 | 23 headers_db | 26218 | 3 | 19 | 4057 | 0 header_accumulated_data_db | 26218 | 3 | 6 | 1010 | 0 block_accumulated_data_db | 26218 | 3 | 99 | 21775 | 1087 block_hashes_db | 26218 | 3 | 9 | 468 | 0 utxos_db | 747509 | 5 | 15022 | 373736 | 0 inputs_db | 560784 | 5 | 5928 | 99085 | 0 txos_hash_to_index_db | 747509 | 4 | 533 | 35242 | 0 kernels_db | 262572 | 5 | 2556 | 39712 | 0 kernel_excess_index | 262572 | 4 | 172 | 11999 | 0 kernel_excess_sig_index | 262572 | 4 | 432 | 15393 | 0 kernel_mmr_size_index | 26218 | 2 | 1 | 170 | 0 output_mmr_size_index | 26218 | 3 | 3 | 438 | 0 utxo_commitment_index | 186725 | 4 | 119 | 6889 | 0 orphans_db | 720 | 3 | 9 | 554 | 1674 orphan_header_accumulated_data_db | 718 | 2 | 1 | 47 | 0 monero_seed_height_db | 1 | 1 | 0 | 1 | 0 orphan_chain_tips_db | 16 | 1 | 0 | 1 | 0 orphan_parent_map_index | 720 | 2 | 1 | 22 | 0 19 databases, page size: 4096 bytes Totalling DB entry sizes. This may take a few seconds... >> Name | Entries | Total Size | Avg. Size/Entry | % of total --------------------------------- | ------- | ---------- | --------------- | ---------- metadata_db | 5 | 0.09 MiB | 18859 bytes | 0.01% headers_db | 26218 | 12.34 MiB | 493 bytes | 0.90% header_accumulated_data_db | 26218 | 3.40 MiB | 136 bytes | 0.25% block_accumulated_data_db | 26218 | 39.25 MiB | 1569 bytes | 2.86% block_hashes_db | 26218 | 1.00 MiB | 40 bytes | 0.07% utxos_db | 747509 | 789.72 MiB | 1107 bytes | 57.51% inputs_db | 560784 | 263.80 MiB | 493 bytes | 19.21% txos_hash_to_index_db | 747509 | 84.83 MiB | 119 bytes | 6.18% kernels_db | 262572 | 90.40 MiB | 361 bytes | 6.58% kernel_excess_index | 262572 | 29.05 MiB | 116 bytes | 2.12% kernel_excess_sig_index | 262572 | 37.06 MiB | 148 bytes | 2.70% kernel_mmr_size_index | 26218 | 0.40 MiB | 16 bytes | 0.03% output_mmr_size_index | 26218 | 1.40 MiB | 56 bytes | 0.10% utxo_commitment_index | 186725 | 12.82 MiB | 72 bytes | 0.93% orphans_db | 720 | 7.51 MiB | 10932 bytes | 0.55% orphan_header_accumulated_data_db | 718 | 0.11 MiB | 160 bytes | 0.01% monero_seed_height_db | 1 | 0.00 MiB | 40 bytes | 0.00% orphan_chain_tips_db | 16 | 0.00 MiB | 72 bytes | 0.00% orphan_parent_map_index | 720 | 0.05 MiB | 72 bytes | 0.00% Total data size: 1373.23 MiB ``` How Has This Been Tested? --- Manually by running `get-db-stats`
- Loading branch information
Showing
17 changed files
with
655 additions
and
112 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.