From 40d989095d3fa49f6e81588402736a9a8bd3821e Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Fri, 12 Jun 2009 15:18:41 -0400 Subject: [PATCH] add config for the BuilderStatus *Horizon options --- buildbot/master.py | 10 ++++++++++ buildbot/status/builder.py | 17 +++++++++++++++-- docs/buildbot.texinfo | 42 +++++++++++++++++++++++++++++++++++++++--- 3 files changed, 64 insertions(+), 5 deletions(-) diff --git a/buildbot/master.py b/buildbot/master.py index 4152307..c1abcbd 100644 --- a/buildbot/master.py +++ b/buildbot/master.py @@ -544,6 +544,7 @@ class BuildMaster(service.MultiService, styles.Versioned): "slavePortnum", "debugPassword", "logCompressionLimit", "manhole", "status", "projectName", "projectURL", "buildbotURL", "properties", "prioritizeBuilders", + "eventHorizon", "buildCacheSize", "logHorizon", "buildHorizon", ) for k in config.keys(): if k not in known_keys: @@ -572,6 +573,10 @@ class BuildMaster(service.MultiService, styles.Versioned): projectURL = config.get('projectURL') buildbotURL = config.get('buildbotURL') properties = config.get('properties', {}) + buildCacheSize = config.get('buildCacheSize', None) + eventHorizon = config.get('eventHorizon', None) + logHorizon = config.get('logHorizon', None) + buildHorizon = config.get('buildHorizon', None) logCompressionLimit = config.get('logCompressionLimit') if logCompressionLimit is not None and not \ isinstance(logCompressionLimit, int): @@ -745,6 +750,11 @@ class BuildMaster(service.MultiService, styles.Versioned): if prioritizeBuilders is not None: self.botmaster.prioritizeBuilders = prioritizeBuilders + self.buildCacheSize = buildCacheSize + self.eventHorizon = eventHorizon + self.logHorizon = logHorizon + self.buildHorizon = buildHorizon + # self.slaves: Disconnect any that were attached and removed from the # list. Update self.checker with the new list of passwords, including # debug/change/status. diff --git a/buildbot/status/builder.py b/buildbot/status/builder.py index b959c73..ad84144 100644 --- a/buildbot/status/builder.py +++ b/buildbot/status/builder.py @@ -1436,7 +1436,7 @@ class BuilderStatus(styles.Versioned): currentBigState = "offline" # or idle/waiting/interlocked/building basedir = None # filled in by our parent - def __init__(self, buildername, category=None): + def __init__(self, buildername, category=None, buildmaster=None): self.name = buildername self.category = category @@ -1455,6 +1455,19 @@ class BuilderStatus(styles.Versioned): self.buildCache_LRU = [] self.logCompressionLimit = False # default to no compression for tests + # use the settings from the buildmaster, if present; otherwise, use the + # defaults from this class. Note that we do not hang onto the buildmaster, + # since this object gets pickled and unpickled. + if buildmaster: + if buildmaster.buildCacheSize: + self.buildCacheSize = buildmaster.buildCacheSize + if buildmaster.eventHorizon: + self.eventHorizon = buildmaster.eventHorizon + if buildmaster.logHorizon: + self.logHorizon = buildmaster.logHorizon + if buildmaster.buildHorizon: + self.buildHorizon = buildmaster.buildHorizon + # persistence def __getstate__(self): @@ -2214,7 +2227,7 @@ class Status: log.msg("error follows:") log.err() if not builder_status: - builder_status = BuilderStatus(name, category) + builder_status = BuilderStatus(name, category, self.botmaster.parent) builder_status.addPointEvent(["builder", "created"]) log.msg("added builder %s in category %s" % (name, category)) # an unpickled object might not have category set from before, diff --git a/docs/buildbot.texinfo b/docs/buildbot.texinfo index f1cd14a..91c7240 100644 --- a/docs/buildbot.texinfo +++ b/docs/buildbot.texinfo @@ -2061,6 +2061,7 @@ understand how to fill in each section properly. * Defining Global Properties:: * Defining Builders:: * Defining Status Targets:: +* Limiting Memory and Disk Usage:: * Debug options:: @end menu @@ -3237,7 +3238,7 @@ c['properties'] = @{ @} @end example -@node Defining Builders, Defining Status Targets, Defining Global Properties, Configuration +@node Defining Builders @section Defining Builders @bcindex c['builders'] @@ -3333,7 +3334,7 @@ builds should be started. @end table -@node Defining Status Targets, Debug options, Defining Builders, Configuration +@node Defining Status Targets @section Defining Status Targets The Buildmaster has a variety of ways to present build status to @@ -3363,8 +3364,43 @@ c['status'].append(words.IRC(host="irc.example.com", nick="bb", Status delivery has its own chapter, @xref{Status Delivery}, in which all the built-in status targets are documented. +@node Limiting Memory and Disk Usage:: +@section Limiting Memory and Disk Usage:: -@node Debug options, , Defining Status Targets, Configuration +Buildbot stores historical information on disk in the form of "Pickle" files +and compressed logfiles. In a large installation, these can quickly consume +disk space, yet in many cases developers never consult this historical +information. Four configuration parameters control the "pruning" of various +data, shown here with their default values: + +@bcindex c['buildHorizon'] +@bcindex c['eventHorizon'] +@bcindex c['logHorizon'] +@bcindex c['buildCacheSize'] +@example +c['buildHorizon'] = 100 +c['eventHorizon'] = 50 +c['logHorizon'] = 40 + +c['buildCacheSize'] = 15 +@end example + +The @code{buildHorizon} specifies the minimum number of builds for each builder +which should be kept on disk. The @code{eventHorizon} specifies the minumum +number of events to keep -- events mostly describe connections and +disconnections of slaves, and are seldom helpful to developers. The +@code{logHorizon} gives the minimum number of builds for which logs should be +maintained; this parameter must be less than @code{buildHorizon}. Builds older +than @code{logHorizon} but not older than @code{buildHorizon} will maintain +their overall status and the status of each step, but the logfiles will be +deleted. + +Finally, the @code{buildCacheSize} gives the number of builds for each builder +which are cached in memory. This number should be larger than the number of +builds required for commonly-used status displays (the waterfall or grid +views), so that those displays do not miss the cache on a refresh. + +@node Debug options @section Debug options -- 2.11.4.GIT