mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-09-01 10:52:33 +01:00
Fixes result result processing bug in sysbench
This commit is contained in:
@@ -162,13 +162,17 @@ def extract_metric(metric, line, result, prefix='', lower_is_better=True):
|
|||||||
if name != metric:
|
if name != metric:
|
||||||
message = 'Name mismatch: expected "{}", got "{}"'
|
message = 'Name mismatch: expected "{}", got "{}"'
|
||||||
raise WorkloadError(message.format(metric, name.strip()))
|
raise WorkloadError(message.format(metric, name.strip()))
|
||||||
|
if not value_part or not value_part[0].isdigit():
|
||||||
|
raise ValueError('value part does not start with a digit: {}'.format(value_part))
|
||||||
idx = -1
|
idx = -1
|
||||||
while value_part[idx - 1].isalpha() and idx: # assumes at least one char of units
|
if not value_part[idx].isdigit(): # units detected at the end of the line
|
||||||
idx -= 1
|
while not value_part[idx - 1].isdigit():
|
||||||
if not idx:
|
idx -= 1
|
||||||
raise WorkloadError('Could not parse value "{}"'.format(value_part))
|
value = numeric(value_part[:idx])
|
||||||
value = numeric(value_part[:idx])
|
units = value_part[idx:]
|
||||||
units = value_part[idx:]
|
else:
|
||||||
|
value = numeric(value_part)
|
||||||
|
units = None
|
||||||
result.add_metric(prefix + metric,
|
result.add_metric(prefix + metric,
|
||||||
value, units, lower_is_better=lower_is_better)
|
value, units, lower_is_better=lower_is_better)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Reference in New Issue
Block a user