forked from denoland/deno
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor benchmark results posting (denoland#3076)
- Loading branch information
1 parent
5bb4de9
commit 6aa8719
Showing
3 changed files
with
24 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env python | ||
# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. | ||
from util import build_path | ||
from benchmark import read_json, write_json | ||
import os | ||
|
||
current_data_file = os.path.join(build_path(), "bench.json") | ||
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. | ||
|
||
assert os.path.exists(current_data_file) | ||
assert os.path.exists(gh_pages_data_file) | ||
|
||
new_data = read_json(current_data_file) | ||
all_data = read_json(gh_pages_data_file) | ||
all_data.append(new_data) | ||
|
||
write_json(all_data_file, all_data) | ||
write_json(recent_data_file, all_data[-20:]) |