-
Notifications
You must be signed in to change notification settings - Fork 990
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
Conversation
…in timestamp, tx pool size)
This is awesome! One small comment in the code, but otherwise LGTM. |
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, |
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.
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.
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.
yep will do
servers/src/grin/server.rs
Outdated
total_difficulty: head.total_difficulty(), | ||
}; | ||
|
||
let disk_usage_gb = { |
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 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
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.
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.
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.
The kernel and rangeproof MMRs should be approx 150MB each on mainnet, regardless of archive mode.
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.
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?
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.
Dependency on walkdir is fine I think. We already use it in the util crate. 👍
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.
Thanks for this!
|
Hi. I added some more stats to the basic status page of the TUI to help node operators.
I've run this against mainnet and everything appears to be updating in real time as expected.