Commit 9673eaff authored by Juan Antonio Navarro Perez's avatar Juan Antonio Navarro Perez Committed by Commit Bot

[tools/perf] Update platforms in docs/speed on perf config changes

Add function on perf_data_generator to keep the list of active platform
configurations in //docs/speed/perf_lab_platforms.md up to date.

Bug: 871746
Cq-Include-Trybots: master.tryserver.chromium.perf:obbs_fyi
Change-Id: I8d95651ad0480f7eb21b8aa6c95af5b75d37da94
Reviewed-on: https://chromium-review.googlesource.com/1166919
Commit-Queue: Juan Antonio Navarro Pérez <perezju@chromium.org>
Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Cr-Commit-Position: refs/heads/master@{#583244}
parent 9b423c7b
[comment]: # (AUTOGENERATED FILE DO NOT EDIT)
[comment]: # (See //tools/perf/generate_perf_data to make changes)
# Platforms tested in the Performance Lab
## Android
* [Nexus
5X](https://build.chromium.org/p/chromium.perf/builders/Android%20Nexus5X%20Perf)
(Chrome and Webview)
* [Nexus
5](https://build.chromium.org/p/chromium.perf/builders/Android%20Nexus5%20Perf)
* [Nexus
6](https://build.chromium.org/p/chromium.perf/builders/Android%20Nexus6%20Perf) (Chrome and WebView)
* [Nexus
7](https://build.chromium.org/p/chromium.perf/builders/Android%20Nexus7v2%20Perf)
* [Android
One](https://build.chromium.org/p/chromium.perf/builders/Android%20One%20Perf)
* [Android Go](https://ci.chromium.org/buildbot/chromium.perf/android-go-perf/)
* [android-go-perf](https://ci.chromium.org/buildbot/chromium.perf/android-go-perf/): Android O.
* [Android Nexus5 Perf](https://ci.chromium.org/buildbot/chromium.perf/Android%20Nexus5%20Perf/): Android KOT49H.
* [android-nexus5x-perf](https://ci.chromium.org/buildbot/chromium.perf/android-nexus5x-perf/): Android MMB29Q.
* [Android Nexus5X WebView Perf](https://ci.chromium.org/buildbot/chromium.perf/Android%20Nexus5X%20WebView%20Perf/): Android AOSP MOB30K.
* [Android Nexus6 WebView Perf](https://ci.chromium.org/buildbot/chromium.perf/Android%20Nexus6%20WebView%20Perf/): Android AOSP MOB30K.
## Linux
* [linux-perf](https://ci.chromium.org/buildbot/chromium.perf/linux-perf/): Ubuntu-14.04, 8 core, NVIDIA Quadro P400.
## Mac
* [Mac
10.11](https://build.chromium.org/p/chromium.perf/builders/Mac%2010.11%20Perf)
* [Mac
10.12](https://build.chromium.org/p/chromium.perf/builders/Mac%2010.12%20Perf)
* [Retina
Mac](https://build.chromium.org/p/chromium.perf/builders/Mac%20Retina%20Perf)
* [Macbook Pro
10.11](https://build.chromium.org/p/chromium.perf/builders/Mac%20Pro%2010.11%20Perf)
* [Macbook Air
10.11](https://build.chromium.org/p/chromium.perf/builders/Mac%20Air%2010.11%20Perf)
* [Mac Mini - 8GB running
10.12](https://build.chromium.org/p/chromium.perf/builders/Mac%20Mini%208GB%2010.12%20Perf)
* [mac-10_12_laptop_low_end-perf](https://ci.chromium.org/buildbot/chromium.perf/mac-10_12_laptop_low_end-perf/): MacBook Air, Core i5 1.8 GHz, 8GB RAM, 128GB SSD, HD Graphics.
* [mac-10_13_laptop_high_end-perf](https://ci.chromium.org/buildbot/chromium.perf/mac-10_13_laptop_high_end-perf/): MacBook Pro, Core i7 2.8 GHz, 16GB RAM, 256GB SSD, Radeon 55.
## Windows
* [Zenbook](https://build.chromium.org/p/chromium.perf/builders/Win%20Zenbook%20Perf)
* [Win 10 - High
DPI](https://build.chromium.org/p/chromium.perf/builders/Win%2010%20High-DPI%20Perf)
* [Win 10](https://build.chromium.org/p/chromium.perf/builders/Win%2010%20Perf)
* [Win 8](https://build.chromium.org/p/chromium.perf/builders/Win%208%20Perf)
* [Win 7](https://build.chromium.org/p/chromium.perf/builders/Win%207%20Perf)
* [Win 7 -
x64](https://build.chromium.org/p/chromium.perf/builders/Win%207%20x64%20Perf)
* [Win 7 with ATI
GPU](https://build.chromium.org/p/chromium.perf/builders/Win%207%20ATI%20GPU%20Perf)
* [Win 7 with Intel
GPU](https://build.chromium.org/p/chromium.perf/builders/Win%207%20Intel%20GPU%20Perf)
* [Win 7 with nVidia
GPU](https://build.chromium.org/p/chromium.perf/builders/Win%207%20Nvidia%20GPU%20Perf)
## Linux
* [win-10-perf](https://ci.chromium.org/buildbot/chromium.perf/win-10-perf/): Windows Intel HD 630 towers, Core i7-7700 3.6 GHz, 16GB RAM, Intel Kaby Lake HD Graphics 630.
* [Win 7 Nvidia GPU Perf](https://ci.chromium.org/buildbot/chromium.perf/Win%207%20Nvidia%20GPU%20Perf/): N/A.
* [Win 7 Perf](https://ci.chromium.org/buildbot/chromium.perf/Win%207%20Perf/): N/A.
* [Ubuntu](https://build.chromium.org/p/chromium.perf/builders/Linux%20Perf)
......@@ -6,37 +6,69 @@ import urllib
class PerfPlatform(object):
def __init__(self, name, is_fyi=False):
def __init__(self, name, description, is_fyi=False):
self._name = name
self._description = description
# For sorting ignore case and "segments" in the bot name.
self._sort_key = name.lower().replace('-', ' ')
self._is_fyi = is_fyi
def __lt__(self, other):
if not isinstance(other, type(self)):
return NotImplemented
# pylint: disable=protected-access
return self._sort_key < other._sort_key
@property
def name(self):
return self._name
@property
def description(self):
return self._description
@property
def platform(self):
value = self._sort_key.split(' ', 1)[0]
return 'windows' if value == 'win' else value
@property
def is_fyi(self):
return self._is_fyi
@property
def buildbot_url(self):
return ('https://ci.chromium.org/buildbot/chromium.perf/%s/' %
urllib.quote(self._name))
# Linux
LINUX = PerfPlatform('linux-perf')
LINUX = PerfPlatform(
'linux-perf', 'Ubuntu-14.04, 8 core, NVIDIA Quadro P400')
# Mac
MAC_HIGH_END = PerfPlatform('mac-10_13_laptop_high_end-perf')
MAC_LOW_END = PerfPlatform('mac-10_12_laptop_low_end-perf')
MAC_HIGH_END = PerfPlatform(
'mac-10_13_laptop_high_end-perf',
'MacBook Pro, Core i7 2.8 GHz, 16GB RAM, 256GB SSD, Radeon 55')
MAC_LOW_END = PerfPlatform(
'mac-10_12_laptop_low_end-perf',
'MacBook Air, Core i5 1.8 GHz, 8GB RAM, 128GB SSD, HD Graphics')
# Win
WIN_10 = PerfPlatform('win-10-perf')
WIN_7 = PerfPlatform('Win 7 Perf')
WIN_7_GPU = PerfPlatform('Win 7 Nvidia GPU Perf')
WIN_10 = PerfPlatform(
'win-10-perf',
'Windows Intel HD 630 towers, Core i7-7700 3.6 GHz, 16GB RAM,'
' Intel Kaby Lake HD Graphics 630')
WIN_7 = PerfPlatform('Win 7 Perf', 'N/A')
WIN_7_GPU = PerfPlatform('Win 7 Nvidia GPU Perf', 'N/A')
# Android
ANDROID_GO = PerfPlatform('android-go-perf')
ANDROID_NEXUS_5 = PerfPlatform('Android Nexus5 Perf')
ANDROID_NEXUS_5X = PerfPlatform('android-nexus5x-perf')
ANDROID_NEXUS_5X_WEBVIEW = PerfPlatform('Android Nexus5X WebView Perf')
ANDROID_NEXUS_6_WEBVIEW = PerfPlatform('Android Nexus6 WebView Perf')
ANDROID_GO = PerfPlatform('android-go-perf', 'Android O')
ANDROID_NEXUS_5 = PerfPlatform('Android Nexus5 Perf', 'Android KOT49H')
ANDROID_NEXUS_5X = PerfPlatform('android-nexus5x-perf', 'Android MMB29Q')
ANDROID_NEXUS_5X_WEBVIEW = PerfPlatform(
'Android Nexus5X WebView Perf', 'Android AOSP MOB30K')
ANDROID_NEXUS_6_WEBVIEW = PerfPlatform(
'Android Nexus6 WebView Perf', 'Android AOSP MOB30K')
ALL_PLATFORMS = {
p for p in locals().values() if isinstance(p, PerfPlatform)
......
......@@ -23,6 +23,7 @@ import sets
import tempfile
from core import bot_platforms
from core import path_util
from core import undocumented_benchmarks as ub_module
path_util.AddTelemetryToPath()
......@@ -806,11 +807,35 @@ def update_benchmark_csv(file_path):
writer.writerows(csv_data)
def validate_tests(waterfall, waterfall_file, benchmark_file):
def update_labs_docs_md(filepath):
configs = collections.defaultdict(list)
for tester in bot_platforms.ALL_PLATFORMS:
if not tester.is_fyi:
configs[tester.platform].append(tester)
with open(filepath, 'w') as f:
f.write("""
[comment]: # (AUTOGENERATED FILE DO NOT EDIT)
[comment]: # (See //tools/perf/generate_perf_data to make changes)
# Platforms tested in the Performance Lab
""")
for platform, testers in sorted(configs.iteritems()):
f.write('## %s\n\n' % platform.title())
testers.sort()
for tester in testers:
f.write(' * [{0.name}]({0.buildbot_url}): {0.description}.\n'.format(
tester))
f.write('\n')
def validate_tests(waterfall, waterfall_file, benchmark_file, labs_docs_file):
up_to_date = True
waterfall_tempfile = tempfile.NamedTemporaryFile(delete=False).name
benchmark_tempfile = tempfile.NamedTemporaryFile(delete=False).name
labs_docs_tempfile = tempfile.NamedTemporaryFile(delete=False).name
try:
update_all_tests(waterfall, waterfall_tempfile)
......@@ -818,9 +843,13 @@ def validate_tests(waterfall, waterfall_file, benchmark_file):
update_benchmark_csv(benchmark_tempfile)
up_to_date &= filecmp.cmp(benchmark_file, benchmark_tempfile)
update_labs_docs_md(labs_docs_tempfile)
up_to_date &= filecmp.cmp(labs_docs_file, labs_docs_tempfile)
finally:
os.remove(waterfall_tempfile)
os.remove(benchmark_tempfile)
os.remove(labs_docs_tempfile)
return up_to_date
......@@ -988,18 +1017,21 @@ def main(args):
benchmark_file = os.path.join(
path_util.GetChromiumSrcDir(), 'tools', 'perf', 'benchmark.csv')
labs_docs_file = os.path.join(
path_util.GetChromiumSrcDir(), 'docs', 'speed', 'perf_lab_platforms.md')
if options.validate_only:
if validate_tests(get_waterfall_builder_config(),
waterfall_file, benchmark_file):
print 'All the perf JSON config files are up-to-date. \\o/'
waterfall_file, benchmark_file, labs_docs_file):
print 'All the perf config files are up-to-date. \\o/'
return 0
else:
print ('The perf JSON config files are not up-to-date. Please run %s '
'without --validate-only flag to update the perf JSON '
'configs and benchmark.csv.') % sys.argv[0]
print ('Not all perf config files are up-to-date. Please run %s '
'to update them.') % sys.argv[0]
return 1
else:
load_and_update_fyi_json(fyi_waterfall_file)
update_all_tests(get_waterfall_builder_config(), waterfall_file)
update_benchmark_csv(benchmark_file)
update_labs_docs_md(labs_docs_file)
return 0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment