Skip to content
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

Switch from integer to float division for benchmark table #828

Merged
merged 2 commits into from
Sep 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions examples/demo-rollup/benches/rollup_coarse_measure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ fn print_times(total: Duration, apply_block_time: Duration, blocks: u64, num_txn
table.add_row(row!["Apply Block", format!("{:?}", apply_block_time)]);
table.add_row(row![
"Txns per sec (TPS)",
format!(
"{:?}",
((blocks * num_txns) as f64) / (total.as_secs() as f64)
)
format!("{:?}", ((blocks * num_txns) as f64) / total.as_secs_f64())
]);

// Print the table to stdout
Expand All @@ -61,11 +58,11 @@ async fn main() -> Result<(), anyhow::Error> {

let start_height: u64 = 0u64;
let mut end_height: u64 = 10u64;
let mut num_txns = 10000;
let mut num_txns_per_block = 10000;
let mut timer_output = true;
let mut prometheus_output = false;
if let Ok(val) = env::var("TXNS_PER_BLOCK") {
num_txns = val
num_txns_per_block = val
.parse()
.expect("TXNS_PER_BLOCK var should be a +ve number");
}
Expand Down Expand Up @@ -158,7 +155,7 @@ async fn main() -> Result<(), anyhow::Error> {

let total = total.elapsed();
if timer_output {
print_times(total, apply_block_time, end_height, num_txns);
print_times(total, apply_block_time, end_height, num_txns_per_block);
}
if prometheus_output {
println!("{:#?}", registry.gather());
Expand Down