Enable the number of runs to be customized

next
Sayan Nandan 3 years ago
parent 0843552dcb
commit 8f4b6b9e5c

@ -37,8 +37,6 @@ use std::net::TcpStream;
/// Just a sweet `*1\n` /// Just a sweet `*1\n`
const SIMPLE_QUERY_SIZE: usize = 3; const SIMPLE_QUERY_SIZE: usize = 3;
const DEFAULT_REPEAT: usize = 5;
/// For a dataframe, this returns the dataframe size for array responses. /// For a dataframe, this returns the dataframe size for array responses.
/// ///
/// For example, /// For example,
@ -118,6 +116,7 @@ pub fn runner(
max_queries: usize, max_queries: usize,
per_kv_size: usize, per_kv_size: usize,
json_out: bool, json_out: bool,
runs: usize,
) { ) {
if !json_out { if !json_out {
println!("Running sanity test ..."); println!("Running sanity test ...");
@ -205,8 +204,8 @@ pub fn runner(
println!("Per-packet size (UPDATE): {} bytes", update_packs[0].len()); println!("Per-packet size (UPDATE): {} bytes", update_packs[0].len());
println!("Initialization complete! Benchmark started"); println!("Initialization complete! Benchmark started");
} }
let mut report = report::AggregatedReport::new(3, DEFAULT_REPEAT, max_queries); let mut report = report::AggregatedReport::new(3, runs, max_queries);
for i in 0..DEFAULT_REPEAT { for i in 1..runs + 1 {
let mut dt = DevTime::new_complex(); let mut dt = DevTime::new_complex();
// clone in the keys // clone in the keys
let set_packs = set_packs.clone(); let set_packs = set_packs.clone();
@ -244,7 +243,7 @@ pub fn runner(
dt.stop_timer("UPDATE").unwrap(); dt.stop_timer("UPDATE").unwrap();
if !json_out { if !json_out {
println!("Finished run: {}", i + 1); println!("Finished run: {}", i);
} }
// drop table // drop table

@ -23,54 +23,61 @@ name: Skytable Benchmark Tool
version: 0.6.0 version: 0.6.0
author: Sayan N. <ohsayan@outlook.com> author: Sayan N. <ohsayan@outlook.com>
about: | about: |
The Skytable benchmark tool can be used to benchmark Skytable installations. The Skytable benchmark tool can be used to benchmark Skytable installations.
If you find any issues, then report one here: https://github.com/skytable/skytable If you find any issues, then report one here: https://github.com/skytable/skytable
args: args:
- connections: - connections:
short: c short: c
long: connections long: connections
value_name: count value_name: count
help: Sets the number of simultaneous clients help: Sets the number of simultaneous clients
takes_value: true takes_value: true
- queries: - queries:
short: q short: q
long: queries long: queries
value_name: number value_name: number
help: Sets the number of queries to run help: Sets the number of queries to run
takes_value: true takes_value: true
- size: - size:
short: s short: s
long: kvsize long: kvsize
value_name: bytes value_name: bytes
help: Sets the size of the key/value pairs help: Sets the size of the key/value pairs
takes_value: true takes_value: true
- json: - json:
required: false required: false
long: json long: json
help: Sets output type to JSON help: Sets output type to JSON
takes_value: false takes_value: false
- host: - host:
short: h short: h
required: false required: false
long: host long: host
value_name: host value_name: host
help: Sets the remote host to connect to help: Sets the remote host to connect to
takes_value: true takes_value: true
- port: - port:
short: p short: p
required: false required: false
long: port long: port
value_name: port value_name: port
help: Sets the remote port to connect to help: Sets the remote port to connect to
takes_value: true takes_value: true
- runs:
short: r
required: false
long: runs
value_name: runs
takes_value: true
help: Sets the number of times the entire test should be run
subcommands: subcommands:
- testkey: - testkey:
about: This can be used to create 'mock' keys about: This can be used to create 'mock' keys
args: args:
- count: - count:
short: c short: c
required: true required: true
long: count long: count
value_name: NUMBEROFKEYS value_name: NUMBEROFKEYS
help: Sets the number of keys to create help: Sets the number of keys to create
takes_value: true takes_value: true

@ -38,6 +38,7 @@ mod report;
mod testkey; mod testkey;
use crate::util::DEFAULT_PACKET_SIZE; use crate::util::DEFAULT_PACKET_SIZE;
use crate::util::DEFAULT_QUERY_COUNT; use crate::util::DEFAULT_QUERY_COUNT;
use crate::util::DEFAULT_REPEAT;
use crate::util::DEFAULT_WORKER_COUNT; use crate::util::DEFAULT_WORKER_COUNT;
// external imports // external imports
use clap::{load_yaml, App}; use clap::{load_yaml, App};
@ -73,6 +74,11 @@ fn main() {
None => DEFAULT_PACKET_SIZE, None => DEFAULT_PACKET_SIZE,
_ => err!("Bad value for key/value size"), _ => err!("Bad value for key/value size"),
}; };
let runs: usize = match matches.value_of("runs").map(|v| v.parse()) {
Some(Ok(r)) => r,
Some(Err(_)) => err!("Bad value for runs"),
None => DEFAULT_REPEAT,
};
if packet_size == 0 || max_queries == 0 || max_connections == 0 { if packet_size == 0 || max_queries == 0 || max_connections == 0 {
err!("All inputs must be non-zero values"); err!("All inputs must be non-zero values");
} }
@ -98,6 +104,7 @@ fn main() {
max_queries, max_queries,
packet_size, packet_size,
json_out, json_out,
runs,
); );
} }
} }

@ -31,6 +31,7 @@ use std::error::Error;
pub const DEFAULT_WORKER_COUNT: usize = 10; pub const DEFAULT_WORKER_COUNT: usize = 10;
pub const DEFAULT_PACKET_SIZE: usize = 8; pub const DEFAULT_PACKET_SIZE: usize = 8;
pub const DEFAULT_QUERY_COUNT: usize = 100_000; pub const DEFAULT_QUERY_COUNT: usize = 100_000;
pub const DEFAULT_REPEAT: usize = 10;
#[macro_export] #[macro_export]
macro_rules! hoststr { macro_rules! hoststr {

Loading…
Cancel
Save