Esempio n. 1
0
def worker_from_git_test():
    # worker is located in the same repo as node
    worker_commit = os.environ.get("NODE_COMMIT", "master")
    mzbench_repo = os.environ.get("MZBENCH_REPO", "https://github.com/machinezone/mzbench")
    run_successful_bench(
        scripts_dir + "worker_from_git.erl", env={"worker_branch": worker_commit, "mzbench_repo": mzbench_repo}
    )
Esempio n. 2
0
def lua_worker_from_git_test():
    worker_commit = os.environ.get('NODE_COMMIT', 'master')
    mzbench_repo = os.environ.get('MZBENCH_REPO', 'https://github.com/satori-com/mzbench')
    env = {'worker_branch': worker_commit,
             'mzbench_repo':  mzbench_repo}
    run_successful_bench(scripts_dir + 'lua_worker_from_git.erl', env=env)
    run_successful_bench(scripts_bdl_dir + 'lua_worker_from_git.bdl', env=env)
Esempio n. 3
0
def env_test():
    run_successful_bench(scripts_dir + 'env.erl', env={
        'jozin': 'bazin',
        'wait_ms': '10',
        'pool_size': '2',
        'loop_time': '5',
        'loop_rate': '2'})
Esempio n. 4
0
def python_worker_from_git_test():
    worker_commit = os.environ.get('NODE_COMMIT', 'master')
    mzbench_repo = os.environ.get('MZBENCH_REPO', 'https://github.com/machinezone/mzbench')
    run_successful_bench(
        scripts_dir + 'python_worker_from_git.erl',
        env={'worker_branch': worker_commit,
             'mzbench_repo':  mzbench_repo})
Esempio n. 5
0
def lua_worker_from_git_test():
    worker_commit = os.environ.get('NODE_COMMIT', 'master')
    mzbench_repo = os.environ.get('MZBENCH_REPO',
                                  'https://github.com/satori-com/mzbench')
    env = {'worker_branch': worker_commit, 'mzbench_repo': mzbench_repo}
    run_successful_bench(scripts_dir + 'lua_worker_from_git.erl', env=env)
    run_successful_bench(scripts_bdl_dir + 'lua_worker_from_git.bdl', env=env)
Esempio n. 6
0
def poisson_worker_start_test():
    run_successful_bench(
        mzbench_dir + 'examples/worker_start_poisson.erl',
        expected_log_message_regex='workers\.pool1\.started\.rps = 1\.')
    run_successful_bench(
        mzbench_dir + 'examples.bdl/worker_start_poisson.bdl',
        expected_log_message_regex='workers\.pool1\.started\.rps = 1\.')
Esempio n. 7
0
def worker_from_git_test():
    # worker is located in the same repo as node
    worker_commit = os.environ.get('NODE_COMMIT', 'master')
    mzbench_repo = os.environ.get('MZBENCH_REPO', 'https://github.com/machinezone/mzbench')
    env = {'worker_branch': worker_commit,
             'mzbench_repo':  mzbench_repo}
    run_successful_bench(scripts_dir + 'worker_from_git.erl', env=env)
    run_successful_bench(scripts_bdl_dir + 'worker_from_git.bdl', env=env)
Esempio n. 8
0
def worker_from_git_test():
    # worker is located in the same repo as node
    worker_commit = os.environ.get('NODE_COMMIT', 'master')
    mzbench_repo = os.environ.get('MZBENCH_REPO', 'https://github.com/machinezone/mzbench')
    env = {'worker_branch': worker_commit,
             'mzbench_repo':  mzbench_repo}
    run_successful_bench(scripts_dir + 'worker_from_git.erl', env=env)
    run_successful_bench(scripts_bdl_dir + 'worker_from_git.bdl', env=env)
Esempio n. 9
0
def poisson_worker_start_test():
    run_successful_bench(
        mzbench_dir + "examples/worker_start_poisson.erl",
        expected_log_message_regex="workers\.pool1\.started\.rps = 1\.",
    )
    run_successful_bench(
        mzbench_dir + "examples.bdl/worker_start_poisson.bdl",
        expected_log_message_regex="workers\.pool1\.started\.rps = 1\.",
    )
Esempio n. 10
0
def check_migrations_test():
    mzbench_data_dir = tempfile.mkdtemp(prefix='mzbench_data_')

    with start_mzbench_server(custom_data_location=mzbench_data_dir):
        for i in range(5):
            run_successful_bench(scripts_dir + 'correct_script.erl')

    try:
        cmd(mzbench_dir + '/bin/migrate.py ' + mzbench_data_dir)
    finally:
        shutil.rmtree(mzbench_data_dir)
Esempio n. 11
0
def check_migrations_test():
    mzbench_data_dir = tempfile.mkdtemp(prefix='mzbench_data_')

    with start_mzbench_server(custom_data_location=mzbench_data_dir):
        for i in range(5):
            run_successful_bench(scripts_dir + 'correct_script.erl')

    try:
        cmd(mzbench_dir + '/bin/migrate.py ' + mzbench_data_dir)
    finally:
        shutil.rmtree(mzbench_data_dir)
Esempio n. 12
0
def hooks_test():
    def check_log(log):
        regex = re.compile(r"Run exec hook \"echo pre_hook_1\"(.*)Run exec hook \"echo pre_hook_2\"(.*)Run exec hook \"echo post_hook_1\"", re.DOTALL)
        assert regex.search(log)

    def check_user_log(log):
        regex = re.compile(r"Dummy print: \"bar\"", re.DOTALL)
        assert regex.search(log)

    run_successful_bench(scripts_dir + 'hooks.erl',
        check_log_function=check_log,
        check_user_log_function=check_user_log)
Esempio n. 13
0
def vars_defaults_test():
    def check_log(log):
        regexp1 = re.compile('the_var1_value_is_var1_default_value', re.DOTALL + re.UNICODE)
        regexp2 = re.compile('the_var2_value_is_var2_new_value', re.DOTALL + re.UNICODE)
        
        if regexp1.search(log) and regexp2.search(log):
            return False
        else:
            return 'Unable to find correct values in log'

    run_successful_bench(scripts_dir + 'vars_defaults.erl',
        env={'var2': 'var2_new_value'},
        check_user_log_function=check_log)
Esempio n. 14
0
def vars_defaults_test():
    def check_log(log):
        regexp1 = re.compile("the_var1_value_is_var1_default_value", re.DOTALL + re.UNICODE)
        regexp2 = re.compile("the_var2_value_is_var2_new_value", re.DOTALL + re.UNICODE)

        if regexp1.search(log) and regexp2.search(log):
            return False
        else:
            return "Unable to find correct values in log"

    run_successful_bench(
        scripts_dir + "vars_defaults.erl", env={"var2": "var2_new_value"}, check_log_function=check_log
    )
Esempio n. 15
0
def data_endpoint_test():
    bench_id = run_successful_bench(scripts_dir + 'data_script.erl')

    csv_data_process = subprocess.Popen(
        [mzbench_script,
            '--host=localhost:4800',
            '--format=csv',
            'data',
            str(bench_id)],
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE)

    json_data_process = subprocess.Popen(
        [mzbench_script,
            '--host=localhost:4800',
            '--format=json',
            'data',
            str(bench_id)],
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE)

    log_process = subprocess.Popen(
        [mzbench_script,
            '--host=localhost:4800',
            'log',
            str(bench_id)],
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE)

    lout, lerr = log_process.communicate()
    print 'Log collector stdout'
    print lout
    print 'Log collector stderr'
    print lerr

    csv_out, csv_err = csv_data_process.communicate()
    print 'CSV data collector stdout'
    print csv_out
    print 'CSV data collector stderr'
    print csv_err

    json_out, json_err = json_data_process.communicate()
    print 'JSON data collector stdout'
    print json_out
    print 'JSON data collector stderr'
    print json_err

    time.sleep(3)

    csv_data_ret_code = csv_data_process.poll()
    json_data_ret_code = json_data_process.poll()

    assert csv_data_ret_code == 0
    assert json_data_ret_code == 0
    assert 'print,' in csv_out
    assert 'print' in\
        [metric['target'] for metric in json.loads(json_out)]
Esempio n. 16
0
def env_change_test():
    def change_var(bid):
        print "Changing env for {0}".format(bid)
        change_env_process = subprocess.Popen([
            mzbench_script, '--host=localhost:4800', 'change_env',
            str(bid), '--env=message=zzz'
        ],
                                              stdout=subprocess.PIPE,
                                              stderr=subprocess.PIPE)
        change_env_res, change_env_err = change_env_process.communicate()
        print 'Change env output: {0}\n{1}'.format(change_env_res,
                                                   change_env_err)
        assert ('set' == json.loads(change_env_res)['status'])
        time.sleep(20)
        change_env_process = subprocess.Popen([
            mzbench_script, '--host=localhost:4800', 'change_env',
            str(bid), '--env=rate=5'
        ],
                                              stdout=subprocess.PIPE,
                                              stderr=subprocess.PIPE)
        change_env_res, change_env_err = change_env_process.communicate()
        print 'Change env output: {0}\n{1}'.format(change_env_res,
                                                   change_env_err)
        assert ('set' == json.loads(change_env_res)['status'])

    bench_id = run_successful_bench(scripts_dir + 'loop_with_vars.erl',
                                    post_start=change_var,
                                    expected_log_message_regex=r'zzz',
                                    env={
                                        'time': '60',
                                        'rate': '1',
                                        'message': 'abc'
                                    })

    json_data_process = subprocess.Popen([
        mzbench_script, '--host=localhost:4800', '--format=json', 'data',
        str(bench_id)
    ],
                                         stdout=subprocess.PIPE,
                                         stderr=subprocess.PIPE)

    json_out, json_err = json_data_process.communicate()

    time.sleep(3)

    json_data_ret_code = json_data_process.poll()
    assert json_data_ret_code == 0
    datapoints = [
        metric['datapoints'] for metric in json.loads(json_out)
        if metric['target'] == 'print.rps'
    ][0]
    values = [d[0] for d in datapoints]
    print "Datapoints: {0}".format(values)
    assert (0.8 < values[2] < 1.2)
    assert (4.8 < values[5] < 5.2)
Esempio n. 17
0
def poisson_worker_start_test():
    bench_id = run_successful_bench(mzbench_dir + 'examples.bdl/worker_start_poisson.bdl')

    output = subprocess.check_output(
        [mzbench_script,
            '--host=localhost:4800',
            '--format=csv',
            'data',
            str(bench_id)])

    assert re.compile('workers\.pool1\.started\.rps,.*,1\.', re.UNICODE).search(output)
Esempio n. 18
0
def poisson_worker_start_test():
    bench_id = run_successful_bench(mzbench_dir + 'examples.bdl/worker_start_poisson.bdl')

    output = subprocess.check_output(
        [mzbench_script,
            '--host=localhost:4800',
            '--format=csv',
            'data',
            str(bench_id)])

    assert re.compile('workers\.pool1\.started\.rps,.*,1\.', re.UNICODE).search(output)
Esempio n. 19
0
def run_command_test():

    def run_command(bid):
        print "Running command for {0}".format(bid)
        change_env_process = subprocess.Popen(
            [mzbench_script,
                '--host=localhost:4800',
                'run_command',
                str(bid),
                'print("zzzzzz999")'],
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE)
        change_env_res, change_env_err = change_env_process.communicate()
        print 'Running command for {0}\n{1}'.format(change_env_res, change_env_err)

    run_successful_bench(
                scripts_dir + 'loop_with_vars.erl',
                post_start=run_command,
                expected_log_message_regex=r'zzzzzz999',
                env={'time': '60', 'rate': '1', 'message':'abc'})
Esempio n. 20
0
def run_command_test():

    def run_command(bid):
        print "Running command for {0}".format(bid)
        change_env_process = subprocess.Popen(
            [mzbench_script,
                '--host=localhost:4800',
                'run_command',
                str(bid),
                'print("zzzzzz999")'],
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE)
        change_env_res, change_env_err = change_env_process.communicate()
        print 'Running command for {0}\n{1}'.format(change_env_res, change_env_err)

    run_successful_bench(
                scripts_dir + 'loop_with_vars.erl',
                post_start=run_command,
                expected_log_message_regex=r'zzzzzz999',
                env={'time': '60', 'rate': '1', 'message':'abc'})
Esempio n. 21
0
def env_change_test():

    def change_var(bid):
        print "Changing env for {0}".format(bid)
        change_env_process = subprocess.Popen(
            [mzbench_script,
                '--host=localhost:4800',
                'change_env',
                str(bid),
                '--env=message=zzz'],
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE)
        change_env_res, change_env_err = change_env_process.communicate()
        print 'Change env output: {0}\n{1}'.format(change_env_res, change_env_err)
        assert('set' == json.loads(change_env_res)['status'])
        time.sleep(20)
        change_env_process = subprocess.Popen(
            [mzbench_script,
                '--host=localhost:4800',
                'change_env',
                str(bid),
                '--env=rate=5'],
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE)
        change_env_res, change_env_err = change_env_process.communicate()
        print 'Change env output: {0}\n{1}'.format(change_env_res, change_env_err)
        assert('set' == json.loads(change_env_res)['status'])

    bench_id = run_successful_bench(
                scripts_dir + 'loop_with_vars.erl',
                post_start=change_var,
                expected_log_message_regex=r'zzz',
                env={'time': '60', 'rate': '1', 'message':'abc'})

    json_data_process = subprocess.Popen(
        [mzbench_script,
            '--host=localhost:4800',
            '--format=json',
            'data',
            str(bench_id)],
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE)

    json_out, json_err = json_data_process.communicate()

    time.sleep(3)

    json_data_ret_code = json_data_process.poll()
    assert json_data_ret_code == 0
    datapoints = [metric['datapoints'] for metric in json.loads(json_out) if metric['target'] == 'print.rps'][0]
    values = [d[0] for d in datapoints]
    print "Datapoints: {0}".format(values)
    assert(0.8 < values[1] < 1.2)
    assert(4.8 < values[4] < 5.2)
Esempio n. 22
0
def workers_per_node_test():
    workers_per_node = 3
    bench_id = run_successful_bench(scripts_dir + "workers_per_node.erl", workers_per_node=workers_per_node)

    log_process = subprocess.Popen(
        [mzbench_script, "--host=localhost:4800", "log", str(bench_id)], stdout=subprocess.PIPE, stderr=subprocess.PIPE
    )
    out, err = log_process.communicate()
    log = "{0} {1}".format(out, err)
    if not re.findall("nodes_arg => 4", log):
        print "Out: ", out
        print "Err: ", err
        raise RuntimeError("The bench should have allocated 4 worker nodes")
Esempio n. 23
0
def workers_per_node_test():
    workers_per_node = 3
    bench_id = run_successful_bench(scripts_dir + 'workers_per_node.erl',
                                    workers_per_node=workers_per_node)

    log_process = subprocess.Popen(
        [mzbench_script, '--host=localhost:4800', 'log',
         str(bench_id)],
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE)
    out, err = log_process.communicate()
    log = "{0} {1}".format(out, err)
    if not re.findall('nodes_arg => 4', log):
        print 'Out: ', out
        print 'Err: ', err
        raise RuntimeError("The bench should have allocated 4 worker nodes")
Esempio n. 24
0
def data_endpoint_test():
    bench_id = run_successful_bench(scripts_dir + "data_script.erl")

    csv_data_process = subprocess.Popen(
        [mzbench_script, "--host=localhost:4800", "--format=csv", "data", str(bench_id)],
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
    )

    json_data_process = subprocess.Popen(
        [mzbench_script, "--host=localhost:4800", "--format=json", "data", str(bench_id)],
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
    )

    log_process = subprocess.Popen(
        [mzbench_script, "--host=localhost:4800", "log", str(bench_id)], stdout=subprocess.PIPE, stderr=subprocess.PIPE
    )

    lout, lerr = log_process.communicate()
    print "Log collector stdout"
    print lout
    print "Log collector stderr"
    print lerr

    csv_out, csv_err = csv_data_process.communicate()
    print "CSV data collector stdout"
    print csv_out
    print "CSV data collector stderr"
    print csv_err

    json_out, json_err = json_data_process.communicate()
    print "JSON data collector stdout"
    print json_out
    print "JSON data collector stderr"
    print json_err

    time.sleep(3)

    csv_data_ret_code = csv_data_process.poll()
    json_data_ret_code = json_data_process.poll()

    assert csv_data_ret_code == 0
    assert json_data_ret_code == 0
    assert "print," in csv_out
    assert "print" in [metric["target"] for metric in json.loads(json_out)]
Esempio n. 25
0
def env_change_test():
    def change_var(bid):
        print "Changing env for {0}".format(bid)
        change_env_process = subprocess.Popen(
            [mzbench_script, "--host=localhost:4800", "change_env", str(bid), "--env=message=zzz"],
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
        )
        change_env_res, change_env_err = change_env_process.communicate()
        print "Change env output: {0}\n{1}".format(change_env_res, change_env_err)
        assert "set" == json.loads(change_env_res)["status"]
        time.sleep(20)
        change_env_process = subprocess.Popen(
            [mzbench_script, "--host=localhost:4800", "change_env", str(bid), "--env=rate=5"],
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
        )
        change_env_res, change_env_err = change_env_process.communicate()
        print "Change env output: {0}\n{1}".format(change_env_res, change_env_err)
        assert "set" == json.loads(change_env_res)["status"]

    bench_id = run_successful_bench(
        scripts_dir + "loop_with_vars.erl",
        post_start=change_var,
        expected_log_message_regex=r"zzz",
        env={"time": "60", "rate": "1", "message": "abc"},
    )

    json_data_process = subprocess.Popen(
        [mzbench_script, "--host=localhost:4800", "--format=json", "data", str(bench_id)],
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
    )

    json_out, json_err = json_data_process.communicate()

    time.sleep(3)

    json_data_ret_code = json_data_process.poll()
    assert json_data_ret_code == 0
    datapoints = [metric["datapoints"] for metric in json.loads(json_out) if metric["target"] == "print.rps"][0]
    values = [d[0] for d in datapoints]
    print "Datapoints: {0}".format(values)
    assert 0.8 < values[2] < 1.2
    assert 4.8 < values[5] < 5.2
Esempio n. 26
0
def bench_results_test():
    bench_id = run_successful_bench(scripts_dir + 'data_script.erl')

    json_results_process = subprocess.Popen(
        [mzbench_script,
            '--host=localhost:4800',
            'results',
            str(bench_id)],
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE)

    log_process = subprocess.Popen(
        [mzbench_script,
            '--host=localhost:4800',
            'log',
            str(bench_id)],
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE)

    lout, lerr = log_process.communicate()
    print 'Log collector stdout'
    print lout
    print 'Log collector stderr'
    print lerr

    json_out, json_err = json_results_process.communicate()
    print 'JSON results collector stdout'
    print json_out
    print 'JSON results collector stderr'
    print json_err

    time.sleep(3)

    json_data_ret_code = json_results_process.poll()

    assert json_data_ret_code == 0
    results = json.loads(json_out)

    assert results["dummy"]["type"] == "histogram"
    assert results["dummy"]["percentiles"]["max"] > 0
    assert results["print"]["type"] == "counter"
    assert results["print"]["value"] == 1
Esempio n. 27
0
def bench_results_test():
    bench_id = run_successful_bench(scripts_dir + 'data_script.erl')

    json_results_process = subprocess.Popen(
        [mzbench_script,
            '--host=localhost:4800',
            'results',
            str(bench_id)],
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE)

    log_process = subprocess.Popen(
        [mzbench_script,
            '--host=localhost:4800',
            'log',
            str(bench_id)],
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE)

    lout, lerr = log_process.communicate()
    print 'Log collector stdout'
    print lout
    print 'Log collector stderr'
    print lerr

    json_out, json_err = json_results_process.communicate()
    print 'JSON results collector stdout'
    print json_out
    print 'JSON results collector stderr'
    print json_err

    time.sleep(3)

    json_data_ret_code = json_results_process.poll()

    assert json_data_ret_code == 0
    results = json.loads(json_out)

    assert results["dummy"]["type"] == "histogram"
    assert results["dummy"]["percentiles"]["max"] > 0
    assert results["print"]["type"] == "counter"
    assert results["print"]["value"] == 1
Esempio n. 28
0
def poisson_loop_test():
    run_successful_bench(scripts_dir + 'loop_poisson.erl')
Esempio n. 29
0
def loop_assert_test():
    run_successful_bench(scripts_bdl_dir + 'loop_while.bdl', env={})
Esempio n. 30
0
def worker_from_rsync_test():
    run_successful_bench(
        scripts_dir + 'worker_from_rsync.erl',
        env={'exec_worker_dir': os.path.abspath('../workers/exec') + '/'})
Esempio n. 31
0
def signal_parallel_test():
    run_successful_bench(scripts_dir + 'signal_parallel.erl', env={})
    run_successful_bench(scripts_bdl_dir + 'signal_parallel.bdl', env={})
Esempio n. 32
0
def unicode_resources_test():
    run_successful_bench(scripts_dir + 'unicode_resource.erl',
        env={'strings_filename':'unicode_strings.txt'})
Esempio n. 33
0
def log_compression_test():
    bench_id = run_successful_bench(scripts_dir + 'correct_script.erl')
    log_cmd = 'curl --head -X GET http://localhost:4800/log?id={0}'.format(bench_id)
    assert("content-encoding: deflate" in cmd(log_cmd))
Esempio n. 34
0
def comb_test():
    run_successful_bench(mzbench_dir + 'examples/comb.erl')
Esempio n. 35
0
def ignore_failure_test():
    run_successful_bench(scripts_dir + 'ignore_failure_test.erl')
Esempio n. 36
0
def wait_zero_signal_test():
    run_successful_bench(scripts_dir + 'wait_zero_signal.erl')
Esempio n. 37
0
def loop_without_rate_test():
    run_successful_bench(scripts_dir + 'superloop.erl')
Esempio n. 38
0
def restart_test():
    bench_id = run_successful_bench(scripts_dir + 'correct_script.erl')
    restarted_id = restart_bench(bench_id)
    cmd(mzbench_dir + 'bin/mzbench status --wait {0}'.format(restarted_id))
Esempio n. 39
0
def main():

    with util.chdir(os.path.join(dirname, '../')):
        serverStatus = checkServer()

        if '--local' in sys.argv:
            if serverStatus == 1:
                print("Please stop MZBench server before running local mode")
                sys.exit()
            run_command = ['../../bin/mzbench', 'run_local']

            with server.background_server():
                subprocess.check_call(run_command + [
                    'examples/http_post.erl', '--env=host=' +
                    hostname, '--env=port=' + str(server.port),
                    '--env=max_rps=2', '--env=endpoint=/update-db'
                ])
                subprocess.check_call(run_command + [
                    'examples/http_get.erl', '--env=host=' +
                    hostname, '--env=port=' + str(server.port),
                    '--env=max_rps=2', '--env=endpoint=/update-db'
                ])
        else:
            if serverStatus == -1:
                print("Non-MZBench server is listening on 4800")
                sys.exit()
            if serverStatus == 0:
                if 'MZBENCH_REPO' in os.environ:
                    mzbench_git_param = '{{node_git, "{0}"}}'.format(
                        os.environ['MZBENCH_REPO'])
                else:
                    mzbench_git_param = ''

                with open(dirname + '/mzbench_server.config', 'w') as config:
                    config.write(
                        '[{{mzbench_api, [{0}]}}].'.format(mzbench_git_param))

                subprocess.check_call([
                    '../../bin/mzbench', 'start_server', '--config',
                    dirname + '/mzbench_server.config'
                ])

            run_command = ['../../bin/mzbench', 'run']

            with server.background_server():
                mzb_test_utils.run_successful_bench('examples/http_post.erl',
                                                    env={
                                                        'host': hostname,
                                                        'port':
                                                        str(server.port),
                                                        'max_rps': '2',
                                                        'endpoint':
                                                        '/update-db'
                                                    })
                mzb_test_utils.run_successful_bench('examples/http_get.erl',
                                                    env={
                                                        'host': hostname,
                                                        'port':
                                                        str(server.port),
                                                        'max_rps': '2',
                                                        'endpoint':
                                                        '/index.html'
                                                    })
            if ('--local' not in sys.argv) and (serverStatus == 0):
                subprocess.check_call(['../../bin/mzbench', 'stop_server'])
Esempio n. 40
0
def signal_count_test():
    run_successful_bench(mzbench_dir + 'examples/signal_count.erl', env={})
    run_successful_bench(mzbench_dir + 'examples.bdl/signal_count.bdl', env={})
Esempio n. 41
0
def poisson_worker_start_test():
    run_successful_bench(mzbench_dir + 'examples/worker_start_poisson.erl',
        expected_log_message_regex='workers\.pool1\.started\.rps = 1\.')
Esempio n. 42
0
def correct_test():
    run_successful_bench(scripts_dir + 'correct_script.erl')
Esempio n. 43
0
def assertions_succ_test():
    run_successful_bench(mzbench_dir + 'examples/assertions.erl', env={})
Esempio n. 44
0
def signal_assert_test():
    run_successful_bench(scripts_bdl_dir + 'signal_assert.bdl', env={})