Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion post_processing/formatter/test_run_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ def _convert_file(self, file_path: Path) -> None:

with open(str(file_path), "r", encoding="utf8") as file:
data: dict[str, Any] = json.load(file)
iodepth: str = f"{data['global options']['iodepth']}"
iodepth: str = self._get_iodepth(
f"{data['global options']['iodepth']}", f"{data['global options']['write_iops_log']}"
)
blocksize: str = f"{data['global options']['bs']}"
operation: str = f"{data['global options']['rw']}"
global_details: IODEPTH_DETAILS_TYPE = self._get_global_options(data["global options"])
Expand Down Expand Up @@ -305,3 +307,29 @@ def _sum_standard_deviation_values(
)

return latency_standard_deviation

def _get_iodepth(self, iodepth_value: str, logfile_name: str) -> str:
"""
Checks to see if the iodepth encoded in the logfile name matches
the iodepth in the output file. If it does, return the iodepth
from the file, otherwise return the iodepth parsed from the
log file path
"""
iodepth: int = int(iodepth_value)

# the logfile name is of the format:
# /tmp/cbt/00000000/LibrbdFio/randwrite_1048576/iodepth-001/numjobs-001/output.0
iodepth_start_index: int = logfile_name.find("iodepth")
numjobs_start_index: int = logfile_name.find("numjobs")
# an index of -1 is no match found, so do nothing
if iodepth_start_index != -1 and numjobs_start_index != -1:
iodepth_end_index: int = iodepth_start_index + len("iodepth")
iodepth_string: str = logfile_name[iodepth_end_index + 1 : numjobs_start_index - 1]
logfile_iodepth: int = int(iodepth_string)

if logfile_iodepth > iodepth:
iodepth = logfile_iodepth

return str(iodepth)

__test__ = False