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

Side by Side Diff: third_party/buildbot_8_4p1/buildbot/status/web/status_json.py

Issue 18429003: Utilize buildCache in a smarter way to prevent pathological disk I/O storms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Add README.chromium diff. Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/buildbot_8_4p1/buildbot/status/builder.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # This file is part of Buildbot. Buildbot is free software: you can 1 # This file is part of Buildbot. Buildbot is free software: you can
2 # redistribute it and/or modify it under the terms of the GNU General Public 2 # redistribute it and/or modify it under the terms of the GNU General Public
3 # License as published by the Free Software Foundation, version 2. 3 # License as published by the Free Software Foundation, version 2.
4 # 4 #
5 # This program is distributed in the hope that it will be useful, but WITHOUT 5 # This program is distributed in the hope that it will be useful, but WITHOUT
6 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 6 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
7 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 7 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
8 # details. 8 # details.
9 # 9 #
10 # You should have received a copy of the GNU General Public License along with 10 # You should have received a copy of the GNU General Public License along with
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 for builderName in self.status.getBuilderNames(): 634 for builderName in self.status.getBuilderNames():
635 if self.name in self.status.getBuilder(builderName).slavenames: 635 if self.name in self.status.getBuilder(builderName).slavenames:
636 self.builders.append(builderName) 636 self.builders.append(builderName)
637 return self.builders 637 return self.builders
638 638
639 def getSlaveBuildMap(self, buildcache, buildercache): 639 def getSlaveBuildMap(self, buildcache, buildercache):
640 for builderName in self.getBuilders(): 640 for builderName in self.getBuilders():
641 if builderName not in buildercache: 641 if builderName not in buildercache:
642 buildercache.add(builderName) 642 buildercache.add(builderName)
643 builder_status = self.status.getBuilder(builderName) 643 builder_status = self.status.getBuilder(builderName)
644 for i in range(1, builder_status.buildCacheSize - 1): 644
645 build_status = builder_status.getBuild(-i) 645 buildnums = range(-1, -(builder_status.buildCacheSize - 1), -1)
646 builds = builder_status.getBuilds(buildnums)
647
648 for build_status in builds:
646 if not build_status or not build_status.isFinished(): 649 if not build_status or not build_status.isFinished():
647 # If not finished, it will appear in runningBuilds. 650 # If not finished, it will appear in runningBuilds.
648 break 651 break
649 slave = buildcache[build_status.getSlavename()] 652 slave = buildcache[build_status.getSlavename()]
650 slave.setdefault(builderName, []).append( 653 slave.setdefault(builderName, []).append(
651 build_status.getNumber()) 654 build_status.getNumber())
652 return buildcache[self.name] 655 return buildcache[self.name]
653 656
654 def asDict(self, request): 657 def asDict(self, request):
655 if not hasattr(request, 'custom_data'): 658 if not hasattr(request, 'custom_data'):
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 if not builder: 759 if not builder:
757 return 760 return
758 EXAMPLES = EXAMPLES.replace('<A_BUILDER>', builder.getName()) 761 EXAMPLES = EXAMPLES.replace('<A_BUILDER>', builder.getName())
759 build = builder.getBuild(-1) 762 build = builder.getBuild(-1)
760 if build: 763 if build:
761 EXAMPLES = EXAMPLES.replace('<A_BUILD>', str(build.getNumber())) 764 EXAMPLES = EXAMPLES.replace('<A_BUILD>', str(build.getNumber()))
762 if builder.slavenames: 765 if builder.slavenames:
763 EXAMPLES = EXAMPLES.replace('<A_SLAVE>', builder.slavenames[0]) 766 EXAMPLES = EXAMPLES.replace('<A_SLAVE>', builder.slavenames[0])
764 767
765 # vim: set ts=4 sts=4 sw=4 et: 768 # vim: set ts=4 sts=4 sw=4 et:
OLDNEW
« no previous file with comments | « third_party/buildbot_8_4p1/buildbot/status/builder.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698