Skip to content

Commit

Permalink
add some useful comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gargnitingoogle committed Nov 4, 2024
1 parent 9fade4f commit a8bf35d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ def writeOutput(
)
continue

# The following try-catch is needed because the parsing
# may fail for some output files. So, rather than stopping
# parsing for the later files, it is important to record such files as
# errors and parse the next files.
try:
new_row = (
record_set["mean_file_size"],
Expand Down Expand Up @@ -333,6 +337,8 @@ def writeOutput(
f"Error while creating new output row for key={key},"
f" scenario={scenario}, epoch={i}, r={r}: {e}"
)
# Put "ERROR" in each field in the row to indicate that this data-row
# could not be parsed.
rows.append((("ERROR",) * len(_HEADER)))

export_to_csv(output_file_path=args.output_file, header=_HEADER, rows=rows)
Expand Down
6 changes: 6 additions & 0 deletions perfmetrics/scripts/testing_on_gke/examples/fio/parse_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ def writeOutput(
)
continue

# The following try-catch is needed because the parsing
# may fail for some output files. So, rather than stopping
# parsing for the later files, it is important to record such files as
# errors and parse the next files.
try:
new_row = (
record_set["mean_file_size"],
Expand Down Expand Up @@ -367,6 +371,8 @@ def writeOutput(
f"Error while creating new output row for key={key},"
f" scenario={scenario}, epoch={i}, r={r}: {e}"
)
# Put "ERROR" in each field in the row to indicate that this data-row
# could not be parsed.
rows.append((("ERROR",) * len(_HEADER)))

export_to_csv(output_file_path=args.output_file, header=_HEADER, rows=rows)
Expand Down

0 comments on commit a8bf35d

Please sign in to comment.