Improve benchmark program output

next
Sayan Nandan 4 years ago
parent f9a79b26c1
commit e8d1c0e90c
No known key found for this signature in database
GPG Key ID: C31EFD7DDA12AEE0

@ -20,9 +20,8 @@
*/ */
//! A generic module for benchmarking SET/GET operations //! A generic module for benchmarking SET/GET operations
//! **NOTE:** This is experimental and only uses a single connection. So any //! **NOTE:** This is experimental and may show incorrect results - that is,
//! benchmark comparisons you might do - aren't fair since it is likely //! the response times may be shown to be slower than they actually are
//! that most of them were done using parallel connections
mod benchtool { mod benchtool {
use corelib::builders::query::QueryBuilder; use corelib::builders::query::QueryBuilder;
@ -194,7 +193,7 @@ mod benchtool {
} }
drop(getpool); drop(getpool);
dt.stop_timer("GET").unwrap(); dt.stop_timer("GET").unwrap();
println!("Benchmark completed! Removing created keys"); println!("Benchmark completed! Removing created keys...");
let mut delpool = Netpool::new(max_connections); let mut delpool = Netpool::new(max_connections);
// Delete all the created keys // Delete all the created keys
for packet in del_packs { for packet in del_packs {
@ -202,14 +201,14 @@ mod benchtool {
} }
drop(delpool); drop(delpool);
println!("==========RESULTS=========="); println!("==========RESULTS==========");
println!(
"{} SETs/sec",
calc(max_queries, dt.time_in_nanos("SET").unwrap())
);
println!( println!(
"{} GETs/sec", "{} GETs/sec",
calc(max_queries, dt.time_in_nanos("GET").unwrap()) calc(max_queries, dt.time_in_nanos("GET").unwrap())
); );
println!(
"{} SETs/sec",
calc(max_queries, dt.time_in_nanos("SET").unwrap())
);
println!("==========================="); println!("===========================");
} }

Loading…
Cancel
Save