def __scenario_markup(scenario_name, scenario_config, metrics, dest_dir, run_id):
    markup = ""

    # add summary line here with core results for scenario, create and show scenario chart
    peak_actions_per_sec = scenario_peak_core_actions_per_sec(scenario_name, metrics, scenario_config)
    if not peak_actions_per_sec:
        print("No data found for scenario (%s) %s" % (run_id, scenario_name))
        markup += "<h3 style=\"font-weight: lighter\">No data found for scenario (%s) %s</h3><br/><br/><br/><br/><br/><br/><br/>" % (run_id, scenario_name)
        return markup
    peak_actions_per_sec_avg = report.arr_avg(peak_actions_per_sec, "actions_per_sec")

    peak_active_clients = map(lambda row: row["proportional_clients_active"], peak_actions_per_sec)
    # get peak users avg
    peak_clients_avg = int(numpy.mean(peak_active_clients))

    # Get whole test period chart for actions/s
    core_action_metrics = __scenario_core_action_metrics(scenario_name, metrics, scenario_config)
    actions_per_sec = __core_actions_per_sec(core_action_metrics, metrics, scenario_config)
    sub_metrics = actions_per_sec
    chart_title = "actions per sec"
    y_label = "Actions/s"
    y_key = "actions_per_sec"
    markup += __chart_and_markup(chart_title, scenario_name, scenario_config, run_id, y_label, y_key, peak_actions_per_sec_avg, peak_clients_avg, sub_metrics, metrics, dest_dir, True)

    # peak period action/s chart
    sub_metrics = peak_actions_per_sec
    chart_title = "peak traffic actions"
    y_label = "Actions/s"
    y_key = "actions_per_sec"
    markup += __chart_and_markup(chart_title, scenario_name, scenario_config, run_id, y_label, y_key, peak_actions_per_sec_avg, peak_clients_avg, sub_metrics, metrics, dest_dir, False)

    # Get whole test period chart for avg duration
    app_page_metrics = __scenario_app_page_metrics(scenario_name, metrics, scenario_config)
    sub_metrics = app_page_metrics
    chart_title = "avg total duration"
    y_label = "Avg total duration (s)"
    y_key = "avg"
    markup += __chart_and_markup(chart_title, scenario_name, scenario_config, run_id, y_label, y_key, peak_actions_per_sec_avg, peak_clients_avg, sub_metrics, metrics, dest_dir, True)

    # Get whole test period chart for avg core action duration
    sub_metrics = core_action_metrics
    chart_title = "core action duration"
    y_label = "Avg duration (s)"
    y_key = "avg"
    markup += __chart_and_markup(chart_title, scenario_name, scenario_config, run_id, y_label, y_key, peak_actions_per_sec_avg, peak_clients_avg, sub_metrics, metrics, dest_dir, True)


    # Get whole test period chart for correctness
    sub_metrics = __correctness_metrics(scenario_name, metrics, scenario_config)
    chart_title = "correctness"
    y_label = "Correctness (1 = 100% correct)"
    markup += __chart_and_markup(chart_title, scenario_name, scenario_config, run_id, y_label, y_key, peak_actions_per_sec_avg, peak_clients_avg, sub_metrics, metrics, dest_dir, True)

    return markup
Example #2
0
def __scenario_markup(scenario_name, scenario_config, metrics, dest_dir,
                      run_id):
    markup = ""

    # add summary line here with core results for scenario, create and show scenario chart
    peak_actions_per_sec = scenario_peak_core_actions_per_sec(
        scenario_name, metrics, scenario_config)
    if not peak_actions_per_sec:
        print("No data found for scenario (%s) %s" % (run_id, scenario_name))
        markup += "<h3 style=\"font-weight: lighter\">No data found for scenario (%s) %s</h3><br/><br/><br/><br/><br/><br/><br/>" % (
            run_id, scenario_name)
        return markup
    peak_actions_per_sec_avg = report.arr_avg(peak_actions_per_sec,
                                              "actions_per_sec")

    peak_active_clients = map(lambda row: row["proportional_clients_active"],
                              peak_actions_per_sec)
    # get peak users avg
    peak_clients_avg = int(numpy.mean(peak_active_clients))

    # Get whole test period chart for actions/s
    core_action_metrics = __scenario_core_action_metrics(
        scenario_name, metrics, scenario_config)
    actions_per_sec = __core_actions_per_sec(core_action_metrics, metrics,
                                             scenario_config)
    sub_metrics = actions_per_sec
    chart_title = "actions per sec"
    y_label = "Actions/s"
    y_key = "actions_per_sec"
    markup += __chart_and_markup(chart_title, scenario_name, scenario_config,
                                 run_id, y_label, y_key,
                                 peak_actions_per_sec_avg, peak_clients_avg,
                                 sub_metrics, metrics, dest_dir, True)

    # peak period action/s chart
    sub_metrics = peak_actions_per_sec
    chart_title = "peak traffic actions"
    y_label = "Actions/s"
    y_key = "actions_per_sec"
    markup += __chart_and_markup(chart_title, scenario_name, scenario_config,
                                 run_id, y_label, y_key,
                                 peak_actions_per_sec_avg, peak_clients_avg,
                                 sub_metrics, metrics, dest_dir, False)

    # Get whole test period chart for avg duration
    app_page_metrics = __scenario_app_page_metrics(scenario_name, metrics,
                                                   scenario_config)
    sub_metrics = app_page_metrics
    chart_title = "avg total duration"
    y_label = "Avg total duration (s)"
    y_key = "avg"
    markup += __chart_and_markup(chart_title, scenario_name, scenario_config,
                                 run_id, y_label, y_key,
                                 peak_actions_per_sec_avg, peak_clients_avg,
                                 sub_metrics, metrics, dest_dir, True)

    # Get whole test period chart for avg core action duration
    sub_metrics = core_action_metrics
    chart_title = "core action duration"
    y_label = "Avg duration (s)"
    y_key = "avg"
    markup += __chart_and_markup(chart_title, scenario_name, scenario_config,
                                 run_id, y_label, y_key,
                                 peak_actions_per_sec_avg, peak_clients_avg,
                                 sub_metrics, metrics, dest_dir, True)

    # Get whole test period chart for correctness
    sub_metrics = __correctness_metrics(scenario_name, metrics,
                                        scenario_config)
    chart_title = "correctness"
    y_label = "Correctness (1 = 100% correct)"
    markup += __chart_and_markup(chart_title, scenario_name, scenario_config,
                                 run_id, y_label, y_key,
                                 peak_actions_per_sec_avg, peak_clients_avg,
                                 sub_metrics, metrics, dest_dir, True)

    return markup
Example #3
0
def scenario_peak_core_actions_per_sec_avg(scenario_name, metrics,
                                           scenario_config):
    actions_per_sec = scenario_peak_core_actions_per_sec(
        scenario_name, metrics, scenario_config)
    return report.arr_avg(actions_per_sec, "actions_per_sec")
def scenario_peak_core_actions_per_sec_avg(scenario_name, metrics, scenario_config):
    actions_per_sec = scenario_peak_core_actions_per_sec(scenario_name, metrics, scenario_config)
    return report.arr_avg(actions_per_sec, "actions_per_sec")