'``RequestLoadScenario`` constructor.
:param tolerance_percentage: error percentage in the rate that is
considered valid. For example, if we request a ``request_rate``
of 20, and we give a tolerance_percentage of 0.2 (20%), anything
in [16,20] will be a valid rate.'

def __init__(self, reactor, request, request_rate=10, sample_size=DEFAULT_SAMPLE_SIZE, timeout=45, tolerance_percentage=0.2):

    self.reactor = reactor
    self.request = request
    self.request_rate = request_rate
    self.timeout = timeout
    self._maintained = Deferred()
    self.rate_measurer = RateMeasurer(sample_size)
    self.max_outstanding = (10 * request_rate)
    self.tolerated_errors = (5 * request_rate)
    self.loop = LoopingCall.withCount(self._request_and_measure)
    self.loop.clock = self.reactor
    self.monitor_loop = LoopingCall(self.check_rate)
    self.monitor_loop.clock = self.reactor
    self.is_started = False
    self.rate_tolerated = (float(request_rate) - (request_rate * tolerance_percentage))
