Chromium Code Reviews| Index: tools/perf/core/perf_data_generator.py |
| diff --git a/tools/perf/core/perf_json_generator.py b/tools/perf/core/perf_data_generator.py |
| similarity index 93% |
| rename from tools/perf/core/perf_json_generator.py |
| rename to tools/perf/core/perf_data_generator.py |
| index 5e908f6f53d8be4f045c53ba7daf1b58e89ebc84..662548f4d841b84b4348a904275672bc89742aa2 100755 |
| --- a/tools/perf/core/perf_json_generator.py |
| +++ b/tools/perf/core/perf_data_generator.py |
| @@ -4,10 +4,11 @@ |
| # found in the LICENSE file. |
| """Script to generate chromium.perf.json and chromium.perf.fyi.json in |
| -the src/testing/buildbot directory. Maintaining these files by hand is |
| -too unwieldy. |
| +the src/testing/buildbot directory and benchmark.csv in the src/tools/perf |
|
ashleymarie1
2017/03/16 17:09:49
Is there a better directory for benchmark.csv to e
|
| +directory. Maintaining these files by hand is too unwieldy. |
| """ |
| import argparse |
| +import csv |
| import json |
| import os |
| import sys |
| @@ -16,6 +17,7 @@ from chrome_telemetry_build import chromium_config |
| sys.path.append(chromium_config.GetTelemetryDir()) |
| from telemetry import benchmark as benchmark_module |
| +from telemetry import decorators |
| from telemetry.core import discover |
| from telemetry.util import bot_utils |
| @@ -654,19 +656,21 @@ LEGACY_DEVICE_AFFIINITY_ALGORITHM = [ |
| 'Win 10 High-DPI Perf', |
| ] |
| -def current_benchmarks(use_whitelist): |
| +def current_benchmarks(use_whitelist, use_blacklist = True): |
| benchmarks_dir = os.path.join(src_dir(), 'tools', 'perf', 'benchmarks') |
| top_level_dir = os.path.dirname(benchmarks_dir) |
| all_benchmarks = discover.DiscoverClasses( |
| benchmarks_dir, top_level_dir, benchmark_module.Benchmark, |
| index_by_class_name=True).values() |
| - # Remove all blacklisted benchmarks |
| - for blacklisted in BENCHMARK_NAME_BLACKLIST: |
| - for benchmark in all_benchmarks: |
| - if benchmark.Name() == blacklisted: |
| - all_benchmarks.remove(benchmark) |
| - break |
| + |
| + if use_blacklist: |
| + # Remove all blacklisted benchmarks |
| + for blacklisted in BENCHMARK_NAME_BLACKLIST: |
| + for benchmark in all_benchmarks: |
| + if benchmark.Name() == blacklisted: |
| + all_benchmarks.remove(benchmark) |
| + break |
| if use_whitelist: |
| all_benchmarks = ( |
| @@ -779,7 +783,7 @@ def generate_all_tests(waterfall): |
| tests[name] = config |
| tests['AAAAA1 AUTOGENERATED FILE DO NOT EDIT'] = {} |
| - tests['AAAAA2 See //tools/perf/generate_perf_json.py to make changes'] = {} |
| + tests['AAAAA2 See //tools/perf/generate_perf_data.py to make changes'] = {} |
| return tests |
| @@ -813,6 +817,48 @@ def src_dir(): |
| os.path.dirname(os.path.dirname(file_path)))) |
| +MANUAL_BENCHMARKS = [ |
| + ["angle_perftests", "jmadill@chromium.org", None], |
| + ["cc_perftest", "enne@chromium.org", None], |
| + ["gpu_perftests", "reveman@chromium.org", None], |
| + ["tracing_perftests", "kkraynov@chromium.org, primiano@chromium.org", |
| + None], |
| + ["indexeddb_perf", "cmumford@chromium.org", None], |
| + ["load_library_perf_tests", None, None], |
| + ["media_perftests", "crouleau@chromium.org", None], |
| + ["performance_browser_tests", |
| + "hubbe@chromium.org, justinlin@chromium.org, miu@chromium.org", None] |
| +] |
| + |
| + |
| +def update_benchmark_csv(): |
| + """Updates go/chrome-benchmarks. |
| + |
| + Updates telemetry/perf/benchmark.csv containing the current benchmark names, |
| + owners, and components. |
| + """ |
| + benchmark_list = current_benchmarks( |
| + use_whitelist = False, use_blacklist = False) |
| + data = MANUAL_BENCHMARKS |
| + for benchmark in benchmark_list: |
| + emails = decorators.GetEmails(benchmark) |
| + if emails: |
| + emails = ", ".join(emails) |
| + data.append([ |
| + benchmark.Name(), |
| + emails, |
| + decorators.GetComponent(benchmark) |
| + ]) |
| + |
| + data = sorted(data, key=lambda b: b[0]) |
| + |
| + perf_dir = os.path.join(src_dir(), 'tools', 'perf') |
| + file = os.path.join(perf_dir, 'benchmark.csv') |
| + with open(file, 'wb') as f: |
| + writer = csv.writer(f) |
| + writer.writerows(data) |
| + |
| + |
| def main(args): |
| parser = argparse.ArgumentParser( |
| description=('Generate perf test\' json config. This need to be done ' |
| @@ -825,6 +871,8 @@ def main(args): |
| 'configs')) |
| options = parser.parse_args(args) |
| + update_benchmark_csv() |
|
ashleymarie1
2017/03/16 17:09:49
Should I add an argument to not update the benchma
|
| + |
| waterfall = get_waterfall_config() |
| waterfall['name'] = 'chromium.perf' |
| fyi_waterfall = get_fyi_waterfall_config() |