diff options
author | Christian Moritz <chrmoritz@users.noreply.github.com> | 2019-10-06 17:18:15 +0200 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-10-06 11:18:15 -0400 |
commit | 3e02d7ddbc04cf3bfc681a5f4cfe6b91a9860cbd (patch) | |
tree | 5ec3a415d8f13e784f74d593680c02c5fca8a9a8 /tools/benchmark.py | |
parent | bed7034fc44a8d20e11a85b6092e7f0f34f43ff8 (diff) |
refactor benchmark results posting (#3076)
Diffstat (limited to 'tools/benchmark.py')
-rwxr-xr-x | tools/benchmark.py | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/tools/benchmark.py b/tools/benchmark.py index 7d812daf3..85e126b88 100755 --- a/tools/benchmark.py +++ b/tools/benchmark.py @@ -10,7 +10,6 @@ import os import sys import json import time -import shutil import tempfile import subprocess from util import build_path, executable_suffix, root_path, run, run_output @@ -30,10 +29,6 @@ exec_time_benchmarks = [ ("workers_round_robin", ["tests/workers_round_robin_bench.ts"]), ] -gh_pages_data_file = "gh-pages/data.json" -all_data_file = "website/data.json" # Includes all benchmark data. -recent_data_file = "website/recent.json" # Includes recent 20 benchmark data. - def read_json(filename): with open(filename) as json_file: @@ -45,19 +40,6 @@ def write_json(filename, data): json.dump(data, outfile) -def import_data_from_gh_pages(): - if os.path.exists(all_data_file): - return - try: - run([ - "git", "clone", "--depth", "1", "-b", "gh-pages", - "https://github.com/denoland/deno.git", "gh-pages" - ]) - shutil.copy(gh_pages_data_file, all_data_file) - except ValueError: - write_json(all_data_file, []) # writes empty json data - - def get_binary_sizes(build_dir): sizes = {} mtimes = {} @@ -246,7 +228,6 @@ def main(argv): deno_exe = os.path.join(build_dir, "deno") os.chdir(root_path) - import_data_from_gh_pages() new_data = { "created_at": time.strftime("%Y-%m-%dT%H:%M:%SZ"), @@ -275,11 +256,7 @@ def main(argv): print json.dumps(new_data, indent=2) print "===== </BENCHMARK RESULTS>" - 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:]) + write_json(os.path.join(build_dir, "bench.json"), new_data) if __name__ == '__main__': |