scripts/nvmf_perf: improve error handling
Add exceptions to results parsing and fio run functions to better inform what's the cause of the failure. Signed-off-by: Karol Latecki <karol.latecki@intel.com> Change-Id: I94e51cb8f77515f7d26a75501011d6111820ae56 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8742 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
2c8baa4685
commit
0574f36dea
@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
from json.decoder import JSONDecodeError
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
@ -524,9 +525,12 @@ class Target(Server):
|
|||||||
|
|
||||||
separate_stats = []
|
separate_stats = []
|
||||||
for r in i_results:
|
for r in i_results:
|
||||||
stats = self.read_json_stats(os.path.join(results_dir, r))
|
try:
|
||||||
separate_stats.append(stats)
|
stats = self.read_json_stats(os.path.join(results_dir, r))
|
||||||
self.log_print(stats)
|
separate_stats.append(stats)
|
||||||
|
self.log_print(stats)
|
||||||
|
except JSONDecodeError as e:
|
||||||
|
self.log_print("ERROR: Failed to parse %s results! Results might be incomplete!")
|
||||||
|
|
||||||
init_results = [sum(x) for x in zip(*separate_stats)]
|
init_results = [sum(x) for x in zip(*separate_stats)]
|
||||||
init_results = [x / len(separate_stats) for x in init_results]
|
init_results = [x / len(separate_stats) for x in init_results]
|
||||||
@ -886,10 +890,14 @@ registerfiles=1
|
|||||||
if run_num:
|
if run_num:
|
||||||
for i in range(1, run_num + 1):
|
for i in range(1, run_num + 1):
|
||||||
output_filename = job_name + "_run_" + str(i) + "_" + self.name + ".json"
|
output_filename = job_name + "_run_" + str(i) + "_" + self.name + ".json"
|
||||||
output = self.exec_cmd(["sudo", self.fio_bin,
|
try:
|
||||||
fio_config_file, "--output-format=json",
|
output = self.exec_cmd(["sudo", self.fio_bin,
|
||||||
"--output=%s" % output_filename], True)
|
fio_config_file, "--output-format=json",
|
||||||
self.log_print(output)
|
"--output=%s" % output_filename], True)
|
||||||
|
self.log_print(output)
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
self.log_print("ERROR: Fio process failed!")
|
||||||
|
self.log_print(e.stdout)
|
||||||
else:
|
else:
|
||||||
output_filename = job_name + "_" + self.name + ".json"
|
output_filename = job_name + "_" + self.name + ".json"
|
||||||
output = self.exec_cmd(["sudo", self.fio_bin,
|
output = self.exec_cmd(["sudo", self.fio_bin,
|
||||||
|
Loading…
Reference in New Issue
Block a user