Skip to content

Commit

Permalink
[cli] show more details of txpool status (#1636)
Browse files Browse the repository at this point in the history
Co-authored-by: jolestar <jolestar@gmail.com>
Co-authored-by: tiangong3624749 <tiangong3624749@163.com>
  • Loading branch information
3 people authored Nov 15, 2020
1 parent ae829ad commit 1665b70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions txpool/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ pub type TxnStatusFullEvent = Arc<Vec<(HashValue, transaction::TxStatus)>>;
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct TxPoolStatus {
pub txn_count: usize,
pub txn_max_count: usize,
pub mem: usize,
pub mem_max: usize,
pub senders: usize,
}

Expand Down
3 changes: 3 additions & 0 deletions txpool/src/pool/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ impl Into<TxPoolStatus> for Status {
fn into(self) -> TxPoolStatus {
TxPoolStatus {
txn_count: self.status.transaction_count,
txn_max_count: self.limits.max_count,
mem: self.status.mem_usage / 1024,
mem_max: self.limits.max_mem_usage / 1024,
senders: self.status.senders,
}
}
Expand Down

0 comments on commit 1665b70

Please sign in to comment.