Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[WebProfilerBundle] Fix panel break when stopwatch component is not installed. #25526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 28, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix panel break when stopwatch component is not installed.
  • Loading branch information
umulmrum committed Dec 17, 2017
commit 410b597393efc5fd5586c7a24fc7fb5ffca64331
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
} %}
{% endif %}

{% set has_time_events = collector.events|length > 0 %}

{% block toolbar %}
{% set total_time = collector.events|length ? '%.0f'|format(collector.duration) : 'n/a' %}
{% set total_time = has_time_events ? '%.0f'|format(collector.duration) : 'n/a' %}
{% set initialization_time = collector.events|length ? '%.0f'|format(collector.inittime) : 'n/a' %}
{% set status_color = collector.events|length and collector.duration > 1000 ? 'yellow' : '' %}
{% set status_color = has_time_events and collector.duration > 1000 ? 'yellow' : '' %}

{% set icon %}
{{ include('@WebProfiler/Icon/time.svg') }}
Expand Down Expand Up @@ -75,10 +77,14 @@
<span class="label">Sub-Request{{ profile.children|length > 1 ? 's' }}</span>
</div>

{% set subrequests_time = 0 %}
{% for child in profile.children %}
{% set subrequests_time = subrequests_time + child.getcollector('time').events.__section__.duration %}
{% endfor %}
{% if has_time_events %}
{% set subrequests_time = 0 %}
{% for child in profile.children %}
{% set subrequests_time = subrequests_time + child.getcollector('time').events.__section__.duration %}
{% endfor %}
{% else %}
{% set subrequests_time = 0 %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be n/a?

Copy link
Contributor Author

@umulmrum umulmrum Dec 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The profiler panel shows 0 for all time values, only the toolbar shows n/a. I can change it to be n/a for all values if you like it better. WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"n/a" looks better to me

{% endif %}

<div class="metric">
<span class="value">{{ subrequests_time }} <span class="unit">ms</span></span>
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.