Add short option for iointerface

This commit is contained in:
Thomas Gebert 2024-12-10 09:38:32 +01:00
parent 70bd09276d
commit f72fabaae7

View File

@ -58,7 +58,6 @@ def ioping_output_shell():
print(stdout) print(stdout)
else: else:
print(stderr) print(stderr)
return returncode return returncode
@ -71,17 +70,17 @@ def ioping_output_telegraf():
return returncode return returncode
ioping_statistic_keys = [ ioping_statistic_keys = [
'statistics_count', 'statistics_count',
'runtime', 'runtime',
'iops', 'iops',
'transfer_speed', 'transfer_speed',
'min_request_time', 'min_request_time',
'avg_request_time', 'avg_request_time',
'max_request_time', 'max_request_time',
'std_deviation_request_time', 'std_deviation_request_time',
'total_requests', 'total_requests',
'total_running_time' 'total_running_time'
] ]
try: try:
ioping_statistics = dict(zip(ioping_statistic_keys, stdout.split())) ioping_statistics = dict(zip(ioping_statistic_keys, stdout.split()))
@ -97,24 +96,24 @@ def ioping_output_telegraf():
def get_parser(): def get_parser():
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-c', '--count', parser.add_argument('-c', '--count',
help = 'stop after <count> requests', help = 'stop after <count> requests',
default = '10') default = '10')
parser.add_argument('-i', '--interval', parser.add_argument('-i', '--interval',
help = 'interval between requests', help = 'interval between requests',
default = '1s') default = '1s')
parser.add_argument('--iointerface',
help = 'Which ionterface to use: async|cached|direct|sync|dsync',
default = '')
parser.add_argument('-l', '--location', parser.add_argument('-l', '--location',
help = 'directory|file|device to test. Best would be a directory to not shred anything accidentially', help = 'directory|file|device to test. Best would be a directory to not shred anything accidentially',
default = '/tmp') default = '/tmp')
parser.add_argument('-m', '--mode', parser.add_argument('-m', '--mode',
help = 'Which output to use: shell|telegraf', help = 'Which output to use: shell|telegraf',
default = 'telegraf') default = 'telegraf')
parser.add_argument('-n', '--iointerface',
help = 'Which ionterface to use: async|cached|direct|sync|dsync',
default = '')
parser.add_argument('-w', '--read-write', parser.add_argument('-w', '--read-write',
help = 'Use read-write test instead of read.', help = 'Use read-write test instead of read.',
action = 'store_true', action = 'store_true',
default = 'False') default = 'False')
return parser return parser