Skip to content
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

fix: Add some more stats to basic status page of TUI (disk usage, chain timestamp, tx pool size) #3046

Merged
merged 3 commits into from
Sep 19, 2019

Conversation

JosephGoulden
Copy link
Contributor

@JosephGoulden JosephGoulden commented Sep 17, 2019

Hi. I added some more stats to the basic status page of the TUI to help node operators.

  • Disk usage measured in GB
  • Chain tip timestamp
  • Tx pool size
  • Stem pool size

I've run this against mainnet and everything appears to be updating in real time as expected.

image

@DavidBurkett
Copy link
Contributor

This is awesome! One small comment in the code, but otherwise LGTM.

@JosephGoulden
Copy link
Contributor Author

Thanks @DavidBurkett but I can't see your comment for some reason.

@@ -51,7 +52,7 @@ pub struct ServerStats {
/// Number of peers
pub peer_count: u32,
/// Chain head
pub head: chain::Tip,
pub chain_stats: ChainStats,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want to replace header_head with a ChainStats as well?
It would be useful to see the timestamp for the header chain during the initial header sync.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep will do

total_difficulty: head.total_difficulty(),
};

let disk_usage_gb = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this is measuring disk usage for the main lmdb database.
We also use significant storage for the various MMR files as well (and the peers lmdb database, but less so).

chain_data/lmdb
chain_data/peer
chain_data/header/header_head
chain_data/header/sync_head
chain_data/txhashset/kernel
chain_data/txhashset/output
chain_data/txhashset/rangeproof

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These looked very small which is why I left them out. But I realise now I'm not running full archive and network activity is only low at the moment. I'll see about adding them to the usage statistic.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The kernel and rangeproof MMRs should be approx 150MB each on mainnet, regardless of archive mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I was not looking hard enough.. I see them now. I added the Walkdir crate to go through the whole db_root dir, it's small has a nice API, do you think it's ok?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dependency on walkdir is fine I think. We already use it in the util crate. 👍

Copy link
Member

@antiochp antiochp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

@antiochp antiochp added this to the 2.1.0 milestone Sep 19, 2019
@antiochp antiochp merged commit 02cee80 into mimblewimble:master Sep 19, 2019
@antiochp
Copy link
Member

Transaction Pool Size and Stem Pool Size are awesome on the summary screen by the way. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants