'Stop the scenario from being maintained by stopping all the
loops that may be executing.
:return Deferred[Optional[Dict[unicode, Any]]]: Scenario metrics.'

def stop(self):

    self.is_started = False
    if self.monitor_loop.running:
        self.monitor_loop.stop()
    if self.loop.running:
        self.loop.stop()
    outstanding_requests = self.rate_measurer.outstanding()
    if (outstanding_requests > 0):
        msg = 'There    are    {num_requests}    outstanding    requests.    Waiting    {num_seconds}    seconds    for    them    to    complete.'.format(num_requests=outstanding_requests, num_seconds=self.timeout)
        Message.log(key='outstanding_requests', value=msg)
    with start_action(action_type=u'flocker:benchmark:scenario:stop', scenario='request_load'):
        def no_outstanding_requests():
            return (self.rate_measurer.outstanding() == 0)
        scenario_stopped = loop_until(self.reactor, no_outstanding_requests, repeat(1))
        timeout(self.reactor, scenario_stopped, self.timeout)
        scenario = DeferredContext(scenario_stopped)
        def handle_timeout(failure):
            failure.trap(CancelledError)
            msg = 'Force    stopping    the    scenario.    There    are    {num_requests}    outstanding    requests'.format(num_requests=outstanding_requests)
            Message.log(key='force_stop_request', value=msg)
        scenario.addErrback(handle_timeout)
        def scenario_cleanup(ignored):
            '\n                                                                Calls    the    scenario    cleanup,    and    wraps    it    inside    an    eliot\n                                                                start    action,    so    we    can    see    the    logs    if    something    goes\n                                                                wrong    within    the    cleanup\n\n                                                                :return    Deferred:    that    will    fire    once    the    cleanup    has    been\n                                                                                completed\n                                                                '
            with start_action(action_type=u'flocker:benchmark:scenario:cleanup', scenario='request_load'):
                return self.request.run_cleanup()
        scenario.addBoth(scenario_cleanup)
        def return_metrics(_ignore):
            return self.rate_measurer.get_metrics()
        scenario.addCallback(return_metrics)
        return scenario.addActionFinish()
