Include percent with rates in "raw" I/O log
This commit is contained in:
parent
4979fbe927
commit
6c4381c3a5
1 changed files with 27 additions and 14 deletions
|
|
@ -68,6 +68,7 @@ TESTS = {
|
||||||
'Status': {},
|
'Status': {},
|
||||||
},
|
},
|
||||||
'iobenchmark': {
|
'iobenchmark': {
|
||||||
|
'Data': {},
|
||||||
'Enabled': False,
|
'Enabled': False,
|
||||||
'Results': {},
|
'Results': {},
|
||||||
'Status': {},
|
'Status': {},
|
||||||
|
|
@ -410,7 +411,9 @@ def run_iobenchmark():
|
||||||
|
|
||||||
# Run dd read tests
|
# Run dd read tests
|
||||||
offset = 0
|
offset = 0
|
||||||
read_rates = []
|
TESTS['iobenchmark']['Data'][name] = {
|
||||||
|
'Graph': [],
|
||||||
|
'Read Rates': []}
|
||||||
for i in range(test_chunks):
|
for i in range(test_chunks):
|
||||||
i += 1
|
i += 1
|
||||||
s = skip_count
|
s = skip_count
|
||||||
|
|
@ -425,12 +428,18 @@ def run_iobenchmark():
|
||||||
o='/dev/null')
|
o='/dev/null')
|
||||||
result = run_program(cmd.split())
|
result = run_program(cmd.split())
|
||||||
result_str = result.stderr.decode().replace('\n', '')
|
result_str = result.stderr.decode().replace('\n', '')
|
||||||
read_rates.append(get_read_rate(result_str))
|
cur_rate = get_read_rate(result_str)
|
||||||
|
TESTS['iobenchmark']['Data'][name]['Read Rates'].append(
|
||||||
|
cur_rate)
|
||||||
|
TESTS['iobenchmark']['Data'][name]['Graph'].append(
|
||||||
|
'{percent:0.1f} {rate}'.format(
|
||||||
|
percent=i/test_chunks*100,
|
||||||
|
rate=int(cur_rate/(1024**2))))
|
||||||
if i % IO_VARS['Progress Refresh Rate'] == 0:
|
if i % IO_VARS['Progress Refresh Rate'] == 0:
|
||||||
# Update vertical graph
|
# Update vertical graph
|
||||||
update_io_progress(
|
update_io_progress(
|
||||||
percent=i/test_chunks*100,
|
percent=i/test_chunks*100,
|
||||||
rate=read_rates[-1],
|
rate=cur_rate,
|
||||||
progress_file=progress_file)
|
progress_file=progress_file)
|
||||||
# Update offset
|
# Update offset
|
||||||
offset += s + c
|
offset += s + c
|
||||||
|
|
@ -440,24 +449,29 @@ def run_iobenchmark():
|
||||||
run_program(['tmux', 'kill-pane', '-t', bottom_pane])
|
run_program(['tmux', 'kill-pane', '-t', bottom_pane])
|
||||||
|
|
||||||
# Build report
|
# Build report
|
||||||
h_graph_rates = []
|
avg_min_max = 'Average read speed: {:3.1f} MB/s (Min: {:3.1f}, Max: {:3.1f})'.format(
|
||||||
|
sum(TESTS['iobenchmark']['Data'][name]['Read Rates'])/len(
|
||||||
|
TESTS['iobenchmark']['Data'][name]['Read Rates'])/(1024**2),
|
||||||
|
min(TESTS['iobenchmark']['Data'][name]['Read Rates'])/(1024**2),
|
||||||
|
max(TESTS['iobenchmark']['Data'][name]['Read Rates'])/(1024**2))
|
||||||
|
TESTS['iobenchmark']['Data'][name]['Avg/Min/Max'] = avg_min_max
|
||||||
|
TESTS['iobenchmark']['Data'][name]['Merged Rates'] = []
|
||||||
pos = 0
|
pos = 0
|
||||||
width = int(test_chunks / IO_VARS['Graph Horizontal Width'])
|
width = int(test_chunks / IO_VARS['Graph Horizontal Width'])
|
||||||
for i in range(IO_VARS['Graph Horizontal Width']):
|
for i in range(IO_VARS['Graph Horizontal Width']):
|
||||||
# Append average rate for WIDTH number of rates to new array
|
# Append average rate for WIDTH number of rates to new array
|
||||||
h_graph_rates.append(sum(read_rates[pos:pos+width])/width)
|
TESTS['iobenchmark']['Data'][name]['Merged Rates'].append(sum(
|
||||||
|
TESTS['iobenchmark']['Data'][name]['Read Rates'][pos:pos+width])/width)
|
||||||
pos += width
|
pos += width
|
||||||
report = generate_horizontal_graph(h_graph_rates)
|
report = generate_horizontal_graph(
|
||||||
report += '\nRead speed: {:3.1f} MB/s (Min: {:3.1f}, Max: {:3.1f})'.format(
|
TESTS['iobenchmark']['Data'][name]['Merged Rates'])
|
||||||
sum(read_rates)/len(read_rates)/(1024**2),
|
report += '\n{}'.format(avg_min_max)
|
||||||
min(read_rates)/(1024**2),
|
|
||||||
max(read_rates)/(1024**2))
|
|
||||||
TESTS['iobenchmark']['Results'][name] = report
|
TESTS['iobenchmark']['Results'][name] = report
|
||||||
|
|
||||||
# Set CS/NS
|
# Set CS/NS
|
||||||
if min(read_rates) <= IO_VARS['Threshold Fail']:
|
if min(TESTS['iobenchmark']['Data'][name]['Read Rates']) <= IO_VARS['Threshold Fail']:
|
||||||
TESTS['iobenchmark']['Status'][name] = 'NS'
|
TESTS['iobenchmark']['Status'][name] = 'NS'
|
||||||
elif min(read_rates) <= IO_VARS['Threshold Warn']:
|
elif min(TESTS['iobenchmark']['Data'][name]['Read Rates']) <= IO_VARS['Threshold Warn']:
|
||||||
TESTS['iobenchmark']['Status'][name] = 'Unknown'
|
TESTS['iobenchmark']['Status'][name] = 'Unknown'
|
||||||
else:
|
else:
|
||||||
TESTS['iobenchmark']['Status'][name] = 'CS'
|
TESTS['iobenchmark']['Status'][name] = 'CS'
|
||||||
|
|
@ -466,8 +480,7 @@ def run_iobenchmark():
|
||||||
dest_filename = '{}/iobenchmark-{}.log'.format(global_vars['LogDir'], name)
|
dest_filename = '{}/iobenchmark-{}.log'.format(global_vars['LogDir'], name)
|
||||||
shutil.move(progress_file, dest_filename)
|
shutil.move(progress_file, dest_filename)
|
||||||
with open(dest_filename.replace('.', '-raw.'), 'a') as f:
|
with open(dest_filename.replace('.', '-raw.'), 'a') as f:
|
||||||
for rate in read_rates:
|
f.write('\n'.join(TESTS['iobenchmark']['Data'][name]['Graph']))
|
||||||
f.write('{} MB/s\n'.format(rate/(1024**2)))
|
|
||||||
update_progress()
|
update_progress()
|
||||||
|
|
||||||
# Done
|
# Done
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue