-
Notifications
You must be signed in to change notification settings - Fork 399
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Hoverbear
committed
Sep 5, 2018
1 parent
2442bef
commit c6dc9d7
Showing
5 changed files
with
123 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,28 @@ | ||
#![allow(dead_code)] // Due to criterion we need this to avoid warnings. | ||
|
||
#[macro_use] | ||
extern crate criterion; | ||
extern crate env_logger; | ||
extern crate raft; | ||
|
||
use criterion::Criterion; | ||
use std::time::Duration; | ||
|
||
mod suites; | ||
use suites::*; | ||
|
||
criterion_main!( | ||
bench_raft, | ||
bench_raw_node, | ||
bench_progress, | ||
bench_progress_set, | ||
); | ||
|
||
pub const DEFAULT_RAFT_SETS: [(usize, usize); 4] = [(0, 0), (3, 1), (5, 2), (7, 3)]; | ||
|
||
fn main() { | ||
criterion::init_logging(); | ||
let mut c = Criterion::default() | ||
// Configure defaults before overriding with args. | ||
.warm_up_time(Duration::from_millis(500)) | ||
.measurement_time(Duration::from_secs(1)) | ||
.configure_from_args(); | ||
|
||
suites::bench_raft(&mut c); | ||
suites::bench_raw_node(&mut c); | ||
suites::bench_progress(&mut c); | ||
suites::bench_progress_set(&mut c); | ||
|
||
c.final_summary(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters