1#!/usr/bin/env python 2# Copyright 2015 The Chromium Authors. All rights reserved. 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5 6import logging 7import multiprocessing 8import sys 9import time 10import traceback 11 12import buildbot 13 14 15POLL_INTERVAL = 600 16BUILD_HISTORY_COUNT = 200 17BUILD_RESULTS_COUNT = 50 18 19 20def FetchLatestBuildResults(builder): 21 try: 22 builder.FetchRecentBuilds(BUILD_HISTORY_COUNT) 23 print 'Fetching results for', builder 24 for build in builder.LastBuilds(BUILD_RESULTS_COUNT): 25 for step in build.steps.itervalues(): 26 step.results # pylint: disable=pointless-statement 27 except: # multiprocessing doesn't give useful stack traces, so print it here. 28 traceback.print_exc(file=sys.stderr) 29 print 30 raise 31 32 33def main(): 34 logging.getLogger().setLevel(logging.INFO) 35 builders = buildbot.Builders('chromium.perf') 36 37 process_pool = multiprocessing.Pool(4) 38 39 while True: 40 print 'Refreshing...' 41 buildbot.Update('chromium.perf', builders) 42 process_pool.map(FetchLatestBuildResults, builders.itervalues()) 43 print 'Refreshed!' 44 time.sleep(POLL_INTERVAL) 45 46 47if __name__ == '__main__': 48 main() 49