varaverk: memory top procs — top 3, inline right of total on same line
This commit is contained in:
@@ -155,7 +155,7 @@ function vv_memory_breakdown(): array {
|
||||
}
|
||||
arsort($grouped);
|
||||
$topProcs = [];
|
||||
foreach (array_slice($grouped, 0, 5, true) as $name => $kb)
|
||||
foreach (array_slice($grouped, 0, 3, true) as $name => $kb)
|
||||
$topProcs[] = ['name' => $name, 'kb' => $kb];
|
||||
|
||||
return [
|
||||
|
||||
@@ -262,14 +262,14 @@ function vvRenderMemory(mem) {
|
||||
|
||||
const procs = mem.top_procs ?? [];
|
||||
const procStrip = procs.map(p =>
|
||||
`<span style="white-space:nowrap;color:#888;font-size:10px;">${p.name} <span style="color:#aaa;font-weight:600;">${vvFmtGib(p.kb)}</span></span>`
|
||||
).join('<span style="color:#333;margin:0 6px;">·</span>');
|
||||
`<span style="white-space:nowrap;">${p.name} <span style="color:#aaa;font-weight:600;">${vvFmtGib(p.kb)}</span></span>`
|
||||
).join('<span style="color:#333;margin:0 5px;">·</span>');
|
||||
|
||||
let html = `<div style="margin-bottom:6px;">
|
||||
<div style="font-size:14px;font-weight:600;color:${totalColor};margin-bottom:5px;">
|
||||
let html = `<div style="display:flex;justify-content:space-between;align-items:baseline;margin-bottom:10px;">
|
||||
<div style="font-size:14px;font-weight:600;color:${totalColor};white-space:nowrap;">
|
||||
${vvFmtGib(usedKb)} <span style="font-size:11px;color:#555;font-weight:400;">/ ${vvFmtGib(total)}</span>
|
||||
</div>
|
||||
<div style="font-size:10px;color:#666;flex-wrap:wrap;line-height:1.8;">${procStrip}</div>
|
||||
<div style="font-size:10px;color:#666;text-align:right;margin-left:10px;">${procStrip}</div>
|
||||
</div>`;
|
||||
html += vvMemRow('System', mem.system_kb ?? 0, total, VV_MEM_COLORS.system)
|
||||
+ vvMemRow('VM', mem.vm_kb ?? 0, total, VV_MEM_COLORS.vm)
|
||||
|
||||
Reference in New Issue
Block a user