Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1027)

Unified Diff: tools/perf/dashboard/query.py

Issue 976823003: [telemetry] DO NOT SUBMIT: WIP: Helper modules for querying buildbot perf data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/perf/dashboard/download.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/dashboard/query.py
diff --git a/tools/perf/dashboard/query.py b/tools/perf/dashboard/query.py
new file mode 100755
index 0000000000000000000000000000000000000000..104cb7a07790f4a4d5a15a226b08d9d671dc9066
--- /dev/null
+++ b/tools/perf/dashboard/query.py
@@ -0,0 +1,68 @@
+#!/usr/bin/env python
+
+import json
+import logging
+import multiprocessing
+import sys
+import time
+
+import buildbot
+
+
+MASTER_NAME = 'chromium.perf'
+BUILDER_NAMES = ('Win 7 Perf (1)', 'Mac 10.9 Perf (1)')
+BENCHMARK_NAME = 'smoothness.top_25_smooth'
+VALUE_NAME = 'frame_times'
+
+BUILD_COUNT = 100
+
+
+def QueryBuild(build):
+ steps = build.steps
+ if not BENCHMARK_NAME in steps:
+ return None
+
+ step = steps[BENCHMARK_NAME]
+ if step.result != buildbot.SUCCESS:
+ return None
+
+ revision_data = []
+ trace_results = step.results['chart_data']['charts'][VALUE_NAME].iteritems()
+ for user_story_name, user_story_data in trace_results:
+ revision_data.append({
+ 'user_story': user_story_name,
+ 'start_time': step.start_time,
+ 'end_time': step.end_time,
+ 'values': user_story_data['values'],
+ })
+ return {
+ 'start_time': build.start_time,
+ 'end_time': build.end_time,
+ 'user_story_runs': revision_data,
+ }
+
+
+def QueryBuilds(builder):
+ return map(QueryBuild, builder.LastBuilds(BUILD_COUNT))
+
+
+def main():
+ logging.getLogger().setLevel(logging.INFO)
+
+ builders = buildbot.Builders(MASTER_NAME)
+ process_pool = multiprocessing.Pool(8)
+
+ start_time = time.time()
+ data = process_pool.map(QueryBuilds,
+ (builders[name] for name in BUILDER_NAMES))
+ data = dict(zip(BUILDER_NAMES, data))
+ logging.info('Queried %d builds in %2.2f seconds.',
+ BUILD_COUNT, time.time() - start_time)
+
+ start_time = time.time()
+ json.dump(data, sys.stdout)
+ logging.info('Wrote data in %2.2f seconds.', time.time() - start_time)
+
+
+if __name__ == '__main__':
+ main()
« no previous file with comments | « tools/perf/dashboard/download.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698