Skip to content

Commit

Permalink
[WebProfilerBundle] changed label of peak memory usage in the time & …
Browse files Browse the repository at this point in the history
…memory panels (MB into MiB)
  • Loading branch information
Lozik authored and nicolas-grekas committed Apr 26, 2020
1 parent 6f5ce1f commit 4da7b8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Resources/views/Collector/memory.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
{% set status_color = (collector.memory / 1024 / 1024) > 50 ? 'yellow' : '' %}
{{ include('@WebProfiler/Icon/memory.svg') }}
<span class="sf-toolbar-value">{{ '%.1f'|format(collector.memory / 1024 / 1024) }}</span>
<span class="sf-toolbar-label">MB</span>
<span class="sf-toolbar-label">MiB</span>
{% endset %}

{% set text %}
<div class="sf-toolbar-info-piece">
<b>Peak memory usage</b>
<span>{{ '%.1f'|format(collector.memory / 1024 / 1024) }} MB</span>
<span>{{ '%.1f'|format(collector.memory / 1024 / 1024) }} MiB</span>
</div>

<div class="sf-toolbar-info-piece">
<b>PHP memory limit</b>
<span>{{ collector.memoryLimit == -1 ? 'Unlimited' : '%.0f MB'|format(collector.memoryLimit / 1024 / 1024) }}</span>
<span>{{ collector.memoryLimit == -1 ? 'Unlimited' : '%.0f MiB'|format(collector.memoryLimit / 1024 / 1024) }}</span>
</div>
{% endset %}

Expand Down
4 changes: 2 additions & 2 deletions Resources/views/Collector/time.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

{% if profile.collectors.memory %}
<div class="metric">
<span class="value">{{ '%.2f'|format(profile.collectors.memory.memory / 1024 / 1024) }} <span class="unit">MB</span></span>
<span class="value">{{ '%.2f'|format(profile.collectors.memory.memory / 1024 / 1024) }} <span class="unit">MiB</span></span>
<span class="label">Peak memory usage</span>
</div>
{% endif %}
Expand Down Expand Up @@ -386,7 +386,7 @@
ctx.fillStyle = "#444";
ctx.font = "12px sans-serif";
text = event.name;
ms = " " + (event.duration < 1 ? event.duration : parseInt(event.duration, 10)) + " ms / " + event.memory + " MB";
ms = " " + (event.duration < 1 ? event.duration : parseInt(event.duration, 10)) + " ms / " + event.memory + " MiB";
if (x + event.starttime * ratio + ctx.measureText(text + ms).width > width) {
ctx.textAlign = "end";
ctx.font = "10px sans-serif";
Expand Down

0 comments on commit 4da7b8b

Please sign in to comment.