Skip to content

Commit 048e6f3

Browse files
minor symfony#36571 [WebProfilerBundle] changed label of peak memory usage in the time & memory panels (MB into MiB) (Lozik)
This PR was squashed before being merged into the 3.4 branch. Discussion ---------- [WebProfilerBundle] changed label of peak memory usage in the time & memory panels (MB into MiB) | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix symfony#36533 | License | MIT | Doc PR | none <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Never break backward compatibility (see https://symfony.com/bc). - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too.) - Features and deprecations must be submitted against branch master. --> This PR changes the label of the peak memory usage from `MB` into `MiB` in the time and memory panels of the web profiler, as discussed in symfony#36533. The changed file `Resources/views/Collector/time.html.twig` is completely updated by commit symfony/web-profiler-bundle@c9433b0 for v4.3. So for correctly displaying the label in 4.4 (& 5.0), the file `Resources/views/Collector/time.js` needs to be updated. Commits ------- 89fb079 [WebProfilerBundle] changed label of peak memory usage in the time & memory panels (MB into MiB)
2 parents 1889672 + 89fb079 commit 048e6f3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/memory.html.twig

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
{% set status_color = (collector.memory / 1024 / 1024) > 50 ? 'yellow' : '' %}
66
{{ include('@WebProfiler/Icon/memory.svg') }}
77
<span class="sf-toolbar-value">{{ '%.1f'|format(collector.memory / 1024 / 1024) }}</span>
8-
<span class="sf-toolbar-label">MB</span>
8+
<span class="sf-toolbar-label">MiB</span>
99
{% endset %}
1010

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

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

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464

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

0 commit comments

Comments
 (0)