Skip to content

Commit

Permalink
Discard (rather than assert) badly formed Block cache stats lines (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
udi-speedb committed Aug 28, 2023
1 parent d600b0e commit b560e96
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions stats_mngr.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,9 @@ def parse_cache_id_line(self, line):

def parse_global_entry_stats_line(self, time, cache_id, line):
line_parts = re.findall(regexes.BLOCK_CACHE_ENTRY_STATS, line)
assert line_parts and len(line_parts) == 1
if not line_parts or len(line_parts) != 1:
raise utils.ParsingError(f"Error parsing line.time:{time}, "
f"line:\n{line}")

roles, roles_stats = BlockCacheStatsMngr.parse_entry_stats_line(
line_parts[0])
Expand Down Expand Up @@ -936,10 +938,9 @@ def parse_entry_stats_line(line):
roles_stats = re.findall(regexes.BLOCK_CACHE_ENTRY_ROLES_STATS,
line)
if len(roles) != len(roles_stats):
assert False, str(ParsingAssertion(
raise utils.ParsingError(
f"Error Parsing block cache stats line. "
f"roles:{roles}, roles_stats:{roles_stats}",
ErrContext(**{'log_line': line})))
f"roles:{roles}, roles_stats:{roles_stats}, line:\n{line}")

return roles, roles_stats

Expand Down

0 comments on commit b560e96

Please sign in to comment.