{% extends "fmd_dashboard/graph-details.html" %} {% macro request_title(request) -%} {# request is a Request-object #}
Request {{ "{}: {:%Y-%m-%d %H:%M:%S }".format(request.id, request.time_requested) }}
{%- endmacro %} {% macro compute_color(percentage) -%} {% set red = 230, 74, 54 %} {# {% set green = 205, 220, 57 %}#} {% set green = 198, 220, 0 %} {% set color_0 = red[0] * percentage + green[0] * (1 - percentage) %} {% set color_1 = red[1] * percentage + green[1] * (1 - percentage) %} {% set color_2 = red[2] * percentage + green[2] * (1 - percentage) %} {{ 'rgb({},{},{})'.format(color_0, color_1, color_2) }} {%- endmacro %} {% block graph_content %} {% macro table_row(request, index) -%} {% set line = request.stack_lines[index] %} {% set sum = request.stack_lines[0].duration %} {% set percentage = line.duration / sum if sum > 0 else 1 %} {{ "{:05d}".format(line.position) }}{{ line.code.code }} {% if body[request.id][index] %} {% endif %} {{ "{:.1f} %".format(percentage * 100) }} {%- endmacro %} {% if pagination %} {{ pagination.info }} {{ pagination.links }} {% endif %} {% for request in requests %}
{{ request_title(request) }}
{% for index in range(request.stack_lines|length) %} {{ table_row(request, index) }} {% endfor %}
Code-line Duration Percentage

{% endfor %} {% if pagination %} {{ pagination.info }} {{ pagination.links }} {% endif %} {% endblock %} {% block script %} {% endblock %}