File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Filter options
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Original file line number Diff line number Diff line change 14
14
} %}
15
15
{% endif %}
16
16
17
+ {% set has_time_events = collector .events | length > 0 %}
18
+
17
19
{% block toolbar %}
18
- {% set total_time = collector . events | length ? ' %.0f' | format (collector .duration ) : ' n/a' %}
20
+ {% set total_time = has_time_events ? ' %.0f' | format (collector .duration ) : ' n/a' %}
19
21
{% set initialization_time = collector .events | length ? ' %.0f' | format (collector .inittime ) : ' n/a' %}
20
- {% set status_color = collector . events | length and collector .duration > 1000 ? ' yellow' : ' ' %}
22
+ {% set status_color = has_time_events and collector .duration > 1000 ? ' yellow' : ' ' %}
21
23
22
24
{% set icon %}
23
25
{{ include (' @WebProfiler/Icon/time.svg' ) }}
75
77
<span class =" label" >Sub-Request{{ profile .children | length > 1 ? ' s' }}</span >
76
78
</div >
77
79
78
- {% set subrequests_time = 0 %}
79
- {% for child in profile .children %}
80
- {% set subrequests_time = subrequests_time + child.getcollector (' time' ).events.__section__ .duration %}
81
- {% endfor %}
80
+ {% if has_time_events %}
81
+ {% set subrequests_time = 0 %}
82
+ {% for child in profile .children %}
83
+ {% set subrequests_time = subrequests_time + child.getcollector (' time' ).events.__section__ .duration %}
84
+ {% endfor %}
85
+ {% else %}
86
+ {% set subrequests_time = 0 %}
87
+ {% endif %}
82
88
83
89
<div class =" metric" >
84
90
<span class =" value" >{{ subrequests_time }} <span class =" unit" >ms</span ></span >
You can’t perform that action at this time.
0 commit comments