Ejemplo n.º 1
0
 def test_duration_updates_counters(self):
     runner = LocalRunner(get_runner_args(
         fqn='loads.examples.test_blog.TestWebSite.test_concurrency',
         output=['null'], duration=2.))
     runner.execute()
     nb_success = runner.test_result.nb_success
     assert nb_success > 2, nb_success
Ejemplo n.º 2
0
 def test_duration_updates_counters(self):
     runner = LocalRunner(get_runner_args(
         fqn='loads.examples.test_blog.TestWebSite.test_concurrency',
         output=['null'], duration=2.))
     runner.execute()
     nb_success = runner.test_result.nb_success
     assert nb_success > 2, nb_success
Ejemplo n.º 3
0
 def test_concurent_session_access(self):
     runner = LocalRunner(get_runner_args(
         fqn='loads.examples.test_blog.TestWebSite.test_concurrency',
         output=['null'], users=2))
     runner.execute()
     nb_success = runner.test_result.nb_success
     assert nb_success == 2, nb_success
     assert runner.test_result.nb_errors == 0
     assert runner.test_result.nb_failures == 0
     assert runner.test_result.get_counter('lavabo') == 2
     assert runner.test_result.get_counter('beau') == 2
Ejemplo n.º 4
0
 def test_concurent_session_access(self):
     runner = LocalRunner(get_runner_args(
         fqn='loads.examples.test_blog.TestWebSite.test_concurrency',
         output=['null'], users=2))
     runner.execute()
     nb_success = runner.test_result.nb_success
     assert nb_success == 2, nb_success
     assert runner.test_result.nb_errors == 0
     assert runner.test_result.nb_failures == 0
     assert runner.test_result.get_counter('lavabo') == 2
     assert runner.test_result.get_counter('beau') == 2
Ejemplo n.º 5
0
    def test_concurrency_duration(self):
        runner = LocalRunner(get_runner_args(
            fqn='loads.examples.test_blog.TestWebSite.test_sleep',
            output=['null'],
            agents=1,
            users=1,
            duration=2,
            concurrency=5
        ))
        runner.execute()

        rps = runner.test_result.requests_per_second()

        assert 14 < rps < 16
Ejemplo n.º 6
0
    def test_concurrency_duration(self):
        runner = LocalRunner(
            get_runner_args(
                fqn="loads.examples.test_blog.TestWebSite.test_sleep",
                output=["null"],
                agents=1,
                users=1,
                duration=2,
                concurrency=5,
            )
        )
        runner.execute()

        rps = runner.test_result.requests_per_second()

        assert 14 < rps < 16
Ejemplo n.º 7
0
def main():
    fqn = sys.argv[1]
    status = os.environ['LOADS_STATUS'].split(',')
    args = get_runner_args(fqn=fqn,
                           zmq_endpoint=os.environ['LOADS_ZMQ_RECEIVER'],
                           agent_id=os.environ['LOADS_AGENT_ID'],
                           run_id=os.environ['LOADS_RUN_ID'],
                           externally_managed=True,
                           loads_status=status,
                           slave=True)
    LocalRunner(args).execute()
Ejemplo n.º 8
0
def main():
    fqn = sys.argv[1]
    status = [
        os.environ.get('LOADS_TOTAL_HITS', '1'),
        os.environ.get('LOADS_TOTAL_USERS', '1'),
        os.environ.get('LOADS_CURRENT_HIT', '1'),
        os.environ.get('LOADS_CURRENT_USER', '1'),
    ]
    args = get_runner_args(fqn=fqn,
                           hits=os.environ.get('LOADS_TOTAL_HITS'),
                           duration=os.environ.get('LOADS_DURATION'),
                           zmq_endpoint=os.environ['LOADS_ZMQ_RECEIVER'],
                           agent_id=os.environ['LOADS_AGENT_ID'],
                           run_id=os.environ['LOADS_RUN_ID'],
                           externally_managed=True,
                           loads_status=status,
                           slave=True)
    LocalRunner(args).execute()