Make scripts/histogram ignore lines without frame duration (#4214)

Previously the script would choke on lines generated, for example, by
`cargo run`.

This just skips lines that don't contain `frame duration:`.

Release Notes:

- N/A
This commit is contained in:
Thorsten Ball 2024-01-23 16:55:48 +01:00 committed by GitHub
commit edfc2e8895
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,7 +41,8 @@ def parse_log_file(file_path):
elif 'µs' in time_with_unit:
time, unit = time_with_unit[:-2], 'µs'
else:
raise ValueError(f"Invalid time unit in line: {line.strip()}")
# Print an error message if we can't parse the line and then continue with rest.
print(f'Error: Invalid time unit in line "{line.strip()}". Skipping.', file=sys.stderr)
continue
data['measurement'].append(measurement)