1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-14 16:33:45 -05:00
denoland-deno/tools/build_benchmark_jsons.py

20 lines
653 B
Python
Raw Normal View History

#!/usr/bin/env python
2020-01-02 15:13:47 -05:00
# Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
2020-01-05 09:19:29 -05:00
import os
from util import build_path
from benchmark import read_json, write_json
current_data_file = os.path.join(build_path(), "bench.json")
all_data_file = "gh-pages/data.json" # Includes all benchmark data.
recent_data_file = "gh-pages/recent.json" # Includes recent 20 benchmark data.
assert os.path.exists(current_data_file)
assert os.path.exists(all_data_file)
new_data = read_json(current_data_file)
all_data = read_json(all_data_file)
all_data.append(new_data)
write_json(all_data_file, all_data)
write_json(recent_data_file, all_data[-20:])