Upgrading clap version to 4.x for skybench (#286)
parent
77b2b25322
commit
927836e170
@ -0,0 +1,78 @@
|
|||||||
|
use clap::{ArgAction, Parser};
|
||||||
|
|
||||||
|
const HELP_TEMPLATE: &'static str = r#"
|
||||||
|
{before-help}{name} {version}
|
||||||
|
{author-with-newline}{about-with-newline}
|
||||||
|
{usage-heading} {usage}
|
||||||
|
|
||||||
|
{all-args}{after-help}
|
||||||
|
"#;
|
||||||
|
|
||||||
|
#[derive(Parser, Debug)]
|
||||||
|
#[command(author, version, about, long_about=None, disable_help_flag=true, help_template=HELP_TEMPLATE)]
|
||||||
|
pub struct Cli {
|
||||||
|
#[arg(
|
||||||
|
short,
|
||||||
|
long,
|
||||||
|
help = "Sets the remote host to connect to",
|
||||||
|
default_value = "127.0.0.1",
|
||||||
|
value_name = "HOST"
|
||||||
|
)]
|
||||||
|
pub host: String,
|
||||||
|
|
||||||
|
#[arg(
|
||||||
|
short,
|
||||||
|
long,
|
||||||
|
help = "Sets the remote port to connect to",
|
||||||
|
default_value_t = 2003,
|
||||||
|
value_name = "PORT"
|
||||||
|
)]
|
||||||
|
pub port: u16,
|
||||||
|
|
||||||
|
#[arg(
|
||||||
|
short = 'c',
|
||||||
|
long = "connections",
|
||||||
|
help = "Sets the number of simultaneous clients",
|
||||||
|
value_name = "COUNT",
|
||||||
|
default_value_t = 10
|
||||||
|
)]
|
||||||
|
pub connections: usize,
|
||||||
|
|
||||||
|
#[arg(
|
||||||
|
short = 'r',
|
||||||
|
long = "runs",
|
||||||
|
help = "Sets the number of times the entire test should be run",
|
||||||
|
value_name = "RUNS",
|
||||||
|
default_value_t = 5
|
||||||
|
)]
|
||||||
|
pub runs: usize,
|
||||||
|
|
||||||
|
#[arg(
|
||||||
|
short = 's',
|
||||||
|
long = "kvsize",
|
||||||
|
help = "Sets the size of the key/value pairs",
|
||||||
|
value_name = "BYTES",
|
||||||
|
default_value_t = 3
|
||||||
|
)]
|
||||||
|
pub kvsize: usize,
|
||||||
|
|
||||||
|
#[arg(
|
||||||
|
short = 'q',
|
||||||
|
long = "queries",
|
||||||
|
help = "Sets the number of queries to run",
|
||||||
|
value_name = "QUERIES",
|
||||||
|
default_value_t = 100_000
|
||||||
|
)]
|
||||||
|
pub query_count: usize,
|
||||||
|
|
||||||
|
#[arg(
|
||||||
|
short = 'j',
|
||||||
|
long = "json",
|
||||||
|
help = "Sets output type to JSON",
|
||||||
|
default_value_t = false
|
||||||
|
)]
|
||||||
|
pub json: bool,
|
||||||
|
|
||||||
|
#[arg(long, help="Print help information", action=ArgAction::Help)]
|
||||||
|
pub help: Option<bool>,
|
||||||
|
}
|
@ -1,72 +0,0 @@
|
|||||||
#
|
|
||||||
# Created on Tue Nov 03 2020
|
|
||||||
#
|
|
||||||
# This file is a part of Skytable
|
|
||||||
# Copyright (c) 2020, Sayan Nandan <ohsayan@outlook.com>
|
|
||||||
#
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU Affero General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
name: Skytable Benchmark Tool
|
|
||||||
version: 0.8.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
|
|
||||||
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
|
|
||||||
- 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
|
|
Loading…
Reference in New Issue