Skip to content

Commit

Permalink
remove more progress bar lengths
Browse files Browse the repository at this point in the history
  • Loading branch information
conradoplg committed Jun 13, 2023
1 parent 678723d commit 4965b2c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 34 deletions.
4 changes: 1 addition & 3 deletions zebra-consensus/src/checkpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,7 @@ where
if matches!(howudoin::cancelled(), Some(true)) {
self.finish_diagnostics();
} else {
self.queued_blocks_bar
.set_pos(max_queued_height.0)
.set_len(u64::from(self.checkpoint_list.max_height().0));
self.queued_blocks_bar.set_pos(max_queued_height.0);
}
}

Expand Down
9 changes: 2 additions & 7 deletions zebra-state/src/service/non_finalized_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -662,9 +662,7 @@ impl NonFinalizedState {
.best_chain()
.map(|chain| chain.non_finalized_root_height().0 - 1);

chain_count_bar
.set_pos(u64::try_from(self.chain_count()).expect("fits in u64"))
.set_len(u64::try_from(MAX_NON_FINALIZED_CHAIN_FORKS).expect("fits in u64"));
chain_count_bar.set_pos(u64::try_from(self.chain_count()).expect("fits in u64"));

if let Some(finalized_tip_height) = finalized_tip_height {
chain_count_bar.desc(format!("Finalized Root {finalized_tip_height}"));
Expand Down Expand Up @@ -701,10 +699,7 @@ impl NonFinalizedState {
// - the chain this bar was previously assigned to might have changed position.
chain_length_bar
.label(format!("Fork {fork_height}"))
.set_pos(u64::try_from(chain.len()).expect("fits in u64"))
.set_len(u64::from(
zebra_chain::transparent::MIN_TRANSPARENT_COINBASE_MATURITY,
));
.set_pos(u64::try_from(chain.len()).expect("fits in u64"));

// display work as bits
let mut desc = format!(
Expand Down
28 changes: 4 additions & 24 deletions zebrad/src/components/mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,41 +411,21 @@ impl Mempool {
|| self.transaction_cost_bar.is_none()
|| self.rejected_count_bar.is_none())
{
let max_transaction_count = self.config.tx_cost_limit
let _max_transaction_count = self.config.tx_cost_limit
/ zebra_chain::transaction::MEMPOOL_TRANSACTION_COST_THRESHOLD;

self.queued_count_bar = Some(
howudoin::new()
.label("Mempool Queue")
.set_pos(0u64)
.set_len(
u64::try_from(downloads::MAX_INBOUND_CONCURRENCY).expect("fits in u64"),
),
);
self.queued_count_bar = Some(*howudoin::new().label("Mempool Queue").set_pos(0u64));

self.transaction_count_bar = Some(
howudoin::new()
.label("Mempool Txs")
.set_pos(0u64)
.set_len(max_transaction_count),
);
self.transaction_count_bar = Some(*howudoin::new().label("Mempool Txs").set_pos(0u64));

self.transaction_cost_bar = Some(
howudoin::new()
.label("Mempool Cost")
.set_pos(0u64)
.set_len(self.config.tx_cost_limit)
.fmt_as_bytes(true),
);

self.rejected_count_bar = Some(
howudoin::new()
.label("Mempool Rejects")
.set_pos(0u64)
.set_len(
u64::try_from(storage::MAX_EVICTION_MEMORY_ENTRIES).expect("fits in u64"),
),
);
self.rejected_count_bar = Some(*howudoin::new().label("Mempool Rejects").set_pos(0u64));
}

// Update if the mempool has ever been active
Expand Down

0 comments on commit 4965b2c

Please sign in to comment.