Last active
December 21, 2015 20:09
-
-
Save indygreg/6359423 to your computer and use it in GitHub Desktop.
Obtain efficiency of buildbot slaves.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The mozautomation package can be found at https://hg.mozilla.org/users/gszorc_mozilla.com/hgext-gecko-dev/ | |
# Usage: python this_script.py 2013-08-25 4 | |
import datetime | |
import sys | |
import time | |
from mozautomation.buildbotdata import BuildbotDump | |
start, count = sys.argv[1:] | |
year, month, day = start.split('-') | |
start_date = datetime.date(int(year), int(month), int(day)) | |
b = BuildbotDump() | |
for i in range(int(count)): | |
delta = datetime.timedelta(i) | |
d = start_date + delta | |
b.load_date(d) | |
slave_groups = b.slave_groups() | |
print('Group\tSlave\t# Jobs\tTotal Duration\tEfficency') | |
for group in sorted(slave_groups.keys()): | |
for name in sorted(slave_groups[group]): | |
build_count, total_duration, active_percent = b.slave_efficiency(slave_name=name) | |
print('%s\t%s\t%d\t%d\t%2.f%%' % (group, name, build_count, total_duration, | |
active_percent * 100)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment