aquatic/aquatic_bench/src/bin/bench_handlers/common.rs
Joakim Frostegård b9a9a82207 bench: add announce and scrape benchmarks
Only announce seems to be faster with more threads
2020-04-13 03:23:17 +02:00

14 lines
386 B
Rust

use indicatif::{ProgressBar, ProgressStyle};
pub const PARETO_SHAPE: f64 = 0.1;
pub const NUM_INFO_HASHES: usize = 10_000;
pub fn create_progress_bar(name: &str, iterations: u64) -> ProgressBar {
let t = format!("{:<16} {}", name, "{wide_bar} {pos:>2}/{len:>2}");
let style = ProgressStyle::default_bar().template(&t);
ProgressBar::new(iterations).with_style(style)
}