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

@ -23,54 +23,61 @@ name: Skytable Benchmark Tool
version: 0.6.0
author: Sayan N. <ohsayan@outlook.com>
about: |
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
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
args:
- connections:
short: c
long: connections
value_name: count
help: Sets the number of simultaneous clients
takes_value: true
- queries:
short: q
long: queries
value_name: number
help: Sets the number of queries to run
takes_value: true
- size:
short: s
long: kvsize
value_name: bytes
help: Sets the size of the key/value pairs
takes_value: true
- json:
required: false
long: json
help: Sets output type to JSON
takes_value: false
- host:
short: h
required: false
long: host
value_name: host
help: Sets the remote host to connect to
takes_value: true
- port:
short: p
required: false
long: port
value_name: port
help: Sets the remote port to connect to
takes_value: true
- connections:
short: c
long: connections
value_name: count
help: Sets the number of simultaneous clients
takes_value: true
- queries:
short: q
long: queries
value_name: number
help: Sets the number of queries to run
takes_value: true
- size:
short: s
long: kvsize
value_name: bytes
help: Sets the size of the key/value pairs
takes_value: true
- json:
required: false
long: json
help: Sets output type to JSON
takes_value: false
- host:
short: h
required: false
long: host
value_name: host
help: Sets the remote host to connect to
takes_value: true
- port:
short: p
required: false
long: port
value_name: port
help: Sets the remote port to connect to
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:
- testkey:
about: This can be used to create 'mock' keys
args:
- count:
short: c
required: true
long: count
value_name: NUMBEROFKEYS
help: Sets the number of keys to create
takes_value: true
- testkey:
about: This can be used to create 'mock' keys
args:
- count:
short: c
required: true
long: count
value_name: NUMBEROFKEYS
help: Sets the number of keys to create
takes_value: true

@ -38,6 +38,7 @@ mod report;
mod testkey;
use crate::util::DEFAULT_PACKET_SIZE;
use crate::util::DEFAULT_QUERY_COUNT;
use crate::util::DEFAULT_REPEAT;
use crate::util::DEFAULT_WORKER_COUNT;
// external imports
use clap::{load_yaml, App};
@ -73,6 +74,11 @@ fn main() {
None => DEFAULT_PACKET_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 {
err!("All inputs must be non-zero values");
}
@ -98,6 +104,7 @@ fn main() {
max_queries,
packet_size,
json_out,
runs,
);
}
}

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

Loading…
Cancel
Save