{% set time_data = [] %}{% set user_count_data = [] %}{% set current_rps_data = [] %}{% set current_fail_per_sec_data = [] %}{% set response_time_percentile_2_data = [] %}{% set response_time_percentile_1_data = [] %}{% for r in history %}{% do time_data.append(r.time) %}{% do user_count_data.append({"value": r.user_count}) %}{% do current_rps_data.append({"value": r.current_rps, "users": r.user_count}) %}{% do current_fail_per_sec_data.append({"value": r.current_fail_per_sec, "users": r.user_count}) %}{% do response_time_percentile_2_data.append({"value": r.response_time_percentile_2, "users": r.user_count}) %}{% do response_time_percentile_1_data.append({"value": r.response_time_percentile_1, "users": r.user_count}) %}{% endfor %}
var stats_history = {
    "time": {{ time_data | tojson }}.map(server_time => new Date(new Date().setUTCHours(...(server_time.split(":")))).toLocaleTimeString()),
    "user_count": {{ user_count_data | tojson }},
    "current_rps": {{ current_rps_data | tojson }},
    "current_fail_per_sec": {{ current_fail_per_sec_data | tojson }},
    "response_time_percentile_1": {{ response_time_percentile_1_data | tojson }},
    "response_time_percentile_2": {{ response_time_percentile_2_data | tojson }},
    "markers": [],
};
