示例#1
0
def __chart_and_markup(title, scenario_name, scenario_config, run_id, y_label,
                       y_key, peak_actions_per_sec_avg, peak_clients_avg,
                       sub_metrics, metrics, dest_dir, display_active_clients):
    markup = ""
    # strip alphanum
    pattern = re.compile('[\W_]+')
    chart_id = "." + pattern.sub('', title)

    chart_name = scenario_name + chart_id
    chart_title = scenario_name + ': ' + title + (" (users: %d)" %
                                                  (peak_clients_avg))
    active_clients = None
    if display_active_clients:
        sub_metrics = __add_active_clients_from_sub_metrics(
            scenario_config, sub_metrics, metrics)
        active_clients = map(lambda row: row["proportional_clients_active"],
                             sub_metrics)

    report.make_time_chart(__report_path(run_id), metrics, chart_title,
                           chart_name, run_id, y_label, sub_metrics, y_key,
                           dest_dir, display_active_clients, active_clients)

    markup += ("""<div>
    <h3 style="font-weight: lighter">Avg %s for scenario: <span style="font-weight: bold">%s</span>, """
               % (title, scenario_name))
    markup += (
        """Peak period average <span style="font-weight: bold">actions/s: %.02f</span> </p>"""
        % peak_actions_per_sec_avg)
    markup += report.chart_markup(chart_name)
    markup += "</div>"

    return markup
示例#2
0
def __page_markup(title, subtitle, config_run, metrics, dest_dir, run_id):
    markup = report.header(title, subtitle, "Scenarios")
    markup += """<div class="scenarios">"""

    scenarios = config_run["config_params"]["scenarios"]
    for scenario_name, scenario_config in scenarios.items():
        markup += __scenario_markup(scenario_name, scenario_config, metrics, dest_dir, run_id)
    markup += """</div>"""

    markup += report.section_title("General results for whole test config", "Normally less useful than scenario stats above because aggregated between different scenarios! Note that flows per second is not adjusted for multiple actions per scenario, so even if a scenario executes 100 actions in one scenario, the whole scenario is calculated as one action.")

    for chart in ["flows_clients", "flows_loadtime", "load", "duration", "active"]:
        markup += report.chart_markup(chart)
    markup += report.footer()
    return markup
示例#3
0
def __page_markup(title, subtitle, config_run, metrics, dest_dir, run_id):
    markup = report.header(title, subtitle, "Scenarios")
    markup += """<div class="scenarios">"""

    scenarios = config_run["config_params"]["scenarios"]
    for scenario_name, scenario_config in scenarios.items():
        markup += __scenario_markup(scenario_name, scenario_config, metrics,
                                    dest_dir, run_id)
    markup += """</div>"""

    markup += report.section_title(
        "General results for whole test config",
        "Normally less useful than scenario stats above because aggregated between different scenarios! Note that flows per second is not adjusted for multiple actions per scenario, so even if a scenario executes 100 actions in one scenario, the whole scenario is calculated as one action."
    )

    for chart in [
            "flows_clients", "flows_loadtime", "load", "duration", "active"
    ]:
        markup += report.chart_markup(chart)
    markup += report.footer()
    return markup
示例#4
0
def __chart_and_markup(title, scenario_name, scenario_config, run_id, y_label, y_key, peak_actions_per_sec_avg, peak_clients_avg, sub_metrics, metrics, dest_dir, display_active_clients):
    markup = ""
    # strip alphanum
    pattern = re.compile('[\W_]+')
    chart_id = "." + pattern.sub('', title)

    chart_name = scenario_name + chart_id
    chart_title = scenario_name + ': ' + title + (" (users: %d)" % (peak_clients_avg))
    active_clients = None
    if display_active_clients:
        sub_metrics = __add_active_clients_from_sub_metrics(scenario_config, sub_metrics, metrics)
        active_clients = map(lambda row: row["proportional_clients_active"], sub_metrics)

    report.make_time_chart(__report_path(run_id), metrics, chart_title, chart_name, run_id, y_label, sub_metrics, y_key, dest_dir, display_active_clients, active_clients)

    markup += ("""<div>
    <h3 style="font-weight: lighter">Avg %s for scenario: <span style="font-weight: bold">%s</span>, """ % (title, scenario_name))
    markup += ("""Peak period average <span style="font-weight: bold">actions/s: %.02f</span> </p>""" % peak_actions_per_sec_avg)
    markup += report.chart_markup(chart_name)
    markup += "</div>"

    return markup
def __combined_scenario_markup(scenario_name, program_runs):
    # create a chart for the scenario with targets and one bar for each program_run
    __target_chart(scenario_name, program_runs)
    # create markup
    return report.chart_markup(__scenario_chart_name(scenario_name), "")
def __combined_scenarios_summary_markup(targets_chart_scenarios, program_runs):
    __combined_target_chart(targets_chart_scenarios, program_runs)
    return report.chart_markup("all_runs_and_targets", "")
示例#7
0
def __combined_scenario_markup(scenario_name, program_runs):
    # create a chart for the scenario with targets and one bar for each program_run
    __target_chart(scenario_name, program_runs)
    # create markup
    return report.chart_markup(__scenario_chart_name(scenario_name), "")
示例#8
0
def __combined_scenarios_summary_markup(targets_chart_scenarios, program_runs):
    __combined_target_chart(targets_chart_scenarios, program_runs)
    return report.chart_markup("all_runs_and_targets", "")