| 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()
|
|
|