Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# Copyright (c) 2014, Facebook, Inc. All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. #
"""Task that executes `execute` at a specified interval
You must either override the `INTERVAL` (seconds) class attribute, or pass a --{OPT_PREFIX}-interval in order for your task to run. """
types=[SampleType.AVG, SampleType.MAX, SampleType.MIN])
default=lambda cls: cls.INTERVAL, help='How often this task should run [%(default)s] (s)')
"""Override this to perform some custom action periodically.""" self.logger.debug('execute')
# Register an event that we can more smartly wait on in case shutdown # is requested while we would be `sleep()`ing
except TryLater: self.n_try_later.increment() continue
else: self.n_slow_iterations.increment()
timer.start() |