def __init__(self, name, shouldntBeSet=NotSet, treeStableTimer=None, builderNames=None, branch=NotABranch, branches=NotABranch, fileIsImportant=None, properties={}, categories=None, change_filter=None, onlyImportant=False): if shouldntBeSet is not self.NotSet: raise config.ConfigErrors( ["pass arguments to schedulers using keyword arguments"]) if fileIsImportant and not callable(fileIsImportant): raise config.ConfigErrors(["fileIsImportant must be a callable"]) # initialize parent classes base.BaseScheduler.__init__(self, name, builderNames, properties) self.treeStableTimer = treeStableTimer self.fileIsImportant = fileIsImportant self.onlyImportant = onlyImportant self.change_filter = self.getChangeFilter(branch=branch, branches=branches, change_filter=change_filter, categories=categories) # the IDelayedCall used to wake up when this scheduler's # treeStableTimer expires. self._stable_timers = bbcollections.defaultdict(lambda: None) self._stable_timers_lock = defer.DeferredLock()
def __init__( self, name, shouldntBeSet=NotSet, treeStableTimer=None, builderNames=None, branch=NotABranch, branches=NotABranch, fileIsImportant=None, properties={}, categories=None, change_filter=None, ): assert shouldntBeSet is self.NotSet, "pass arguments to schedulers using keyword arguments" if fileIsImportant: assert callable(fileIsImportant) # initialize parent classes base.BaseScheduler.__init__(self, name, builderNames, properties) self.treeStableTimer = treeStableTimer self.fileIsImportant = fileIsImportant self.change_filter = self.getChangeFilter( branch=branch, branches=branches, change_filter=change_filter, categories=categories ) # the IDelayedCall used to wake up when this scheduler's # treeStableTimer expires. self._stable_timers = bbcollections.defaultdict(lambda: None) self._stable_timers_lock = defer.DeferredLock()
def __init__(self, max_size=50): self.max_size = max_size self.max_queue = max_size * 10 self.queue = deque() self.cache = {} self.weakrefs = WeakValueDictionary() self.concurrent = {} self.hits = self.misses = self.refhits = 0 self.refcount = defaultdict(default_factory=lambda: 0)
def __init__(self, max_size=50): self.max_size = max_size self.max_queue = max_size * 10 self.queue = deque() self.cache = {} self.weakrefs = WeakValueDictionary() self.concurrent = {} self.hits = self.misses = self.refhits = 0 self.refcount = defaultdict(default_factory = lambda : 0)
def __init__(self, miss_fn, max_size=50): self.miss_fn = miss_fn self.max_size = max_size self.max_queue = max_size * self.QUEUE_SIZE_FACTOR self.queue = deque() self.cache = {} self.weakrefs = WeakValueDictionary() self.concurrent = {} self.hits = self.misses = self.refhits = 0 self.refcount = defaultdict(lambda : 0)
def __init__(self, buildprogress): """Create us from a successful build. We will expect each step to take as long as it did in that build.""" # .steps maps stepname to dict2 # dict2 maps metricname to final end-of-step value self.steps = defaultdict(dict) # .times maps stepname to per-step elapsed time self.times = {} for name, step in buildprogress.steps.items(): self.steps[name] = {} for metric, value in step.progress.items(): self.steps[name][metric] = value self.times[name] = None if step.startTime is not None and step.stopTime is not None: self.times[name] = step.stopTime - step.startTime
def __init__(self, miss_fn, max_size=50): """ Constructor. @param miss_fn: function to call, with key as parameter, for cache misses. This function I{must} return a deferred. @param max_size: maximum number of objects in the cache """ self.miss_fn = miss_fn self.max_size = max_size self.max_queue = max_size * self.QUEUE_SIZE_FACTOR self.queue = deque() self.cache = {} self.weakrefs = WeakValueDictionary() self.concurrent = {} self.hits = self.misses = self.refhits = 0 self.refcount = defaultdict(lambda : 0)
def reset(self): self._timers = defaultdict(AveragingFiniteList)
def reset(self): self._counters = defaultdict(int)
def reset(self): self._alarms = defaultdict(lambda x: ALARM_OK)
def __init__(self, master): service.MultiService.__init__(self) self.master = master self.upstream_subscribers = bbcollections.defaultdict(list) self._updateLock = defer.DeferredLock()
def setUp(self): self.dd = bbcollections.defaultdict(list)