xla
3105be6e - benchmarks: save timestamp in json output (#6163)

Commit
2 years ago
benchmarks: save timestamp in json output (#6163) So that benchmarks run from the same invocation get the same timestamp. I'm adding timestamps to old JSONL output files with this script: ```` import json import sys def replace_timestamps(filename, timestamp): with open(filename) as read_file: for line in read_file: try: r = json.loads(line.rstrip('\n|\r')) except json.JSONDecodeError as e: sys.exit(f'Invalid JSONL:\n{line}{e}') if 'timestamp' not in r: r['timestamp'] = float(timestamp) print(json.dumps(r)) def main(): if len(sys.argv) != 3: sys.exit("Usage: add_timestamp.py input_file timestamp") filename = sys.argv[1] timestamp = sys.argv[2] replace_timestamps(filename, timestamp) if __name__ == '__main__': main() ```
Author
Parents
Loading