| OLD | NEW |
| (Empty) | |
| 1 #!/usr/bin/env python |
| 2 |
| 3 import logging |
| 4 import multiprocessing |
| 5 import sys |
| 6 import time |
| 7 import traceback |
| 8 |
| 9 import buildbot |
| 10 |
| 11 |
| 12 POLL_INTERVAL = 600 |
| 13 BUILD_HISTORY_COUNT = 200 |
| 14 BUILD_RESULTS_COUNT = 50 |
| 15 |
| 16 |
| 17 def FetchLatestBuildResults(builder): |
| 18 try: |
| 19 builder.FetchRecentBuilds(BUILD_HISTORY_COUNT) |
| 20 print 'Fetching results for', builder |
| 21 for build in builder.LastBuilds(BUILD_RESULTS_COUNT): |
| 22 for step in build.steps.itervalues(): |
| 23 step.results # pylint: disable=pointless-statement |
| 24 except: # multiprocessing doesn't give useful stack traces, so print it here. |
| 25 traceback.print_exc(file=sys.stderr) |
| 26 print |
| 27 raise |
| 28 |
| 29 |
| 30 def main(): |
| 31 logging.getLogger().setLevel(logging.INFO) |
| 32 builders = buildbot.Builders('chromium.perf') |
| 33 |
| 34 process_pool = multiprocessing.Pool(4) |
| 35 |
| 36 while True: |
| 37 print 'Refreshing...' |
| 38 buildbot.Update('chromium.perf', builders) |
| 39 process_pool.map(FetchLatestBuildResults, builders.itervalues()) |
| 40 print 'Refreshed!' |
| 41 time.sleep(POLL_INTERVAL) |
| 42 |
| 43 |
| 44 if __name__ == '__main__': |
| 45 main() |
| OLD | NEW |