Say what Varaverk itself is using on the System card
The card described the machine and said nothing about the thing whose dashboard it is. Cache size matters most: VV_CACHE_ROOT is under /tmp, which on Unraid is RAM, so it is shown against the rootfs percentage it counts against. Jobs are locks with a live process — four lock files were sitting there and one job was actually running.
This commit is contained in:
@@ -949,6 +949,55 @@ function vvPollMonitor(live) {
|
||||
: '—';
|
||||
const _coreMeta = _threadInfo ? ` <span style="color:#444;">(${_threadInfo})</span>` : '';
|
||||
|
||||
// ── Varaverk's own footprint ────────────────────────────────────────────
|
||||
// The rows above describe the machine. These describe the thing whose dashboard this is,
|
||||
// and nothing else on the page reports them.
|
||||
const vv = d.varaverk ?? {};
|
||||
const _rootPct = d.watchdog?.stability?.rootfs_pct ?? null;
|
||||
|
||||
// The cache is RAM, not disk: VV_CACHE_ROOT is /tmp/varaverk and /tmp lives on rootfs, which
|
||||
// on Unraid is a memory filesystem. Shown against the rootfs percentage because a size with
|
||||
// no ceiling beside it is a number nobody can act on.
|
||||
// Local formatters. vvFmt() is a GB formatter — feeding it megabytes prints "186 GB" — and
|
||||
// vvRelTime() takes a timestamp where these carry an age in seconds. Both would have been
|
||||
// silently wrong rather than broken.
|
||||
const _vvSize = b => b == null ? '—'
|
||||
: b >= 1073741824 ? (b / 1073741824).toFixed(1) + ' GB' : Math.round(b / 1048576) + ' MB';
|
||||
const _vvAge = s => s == null ? '—'
|
||||
: s < 90 ? s + 's' : s < 5400 ? Math.round(s / 60) + 'm'
|
||||
: s < 172800 ? Math.round(s / 3600) + 'h' : Math.round(s / 86400) + 'd';
|
||||
|
||||
const _cacheColor = _rootPct == null ? '#888'
|
||||
: _rootPct >= 90 ? '#f44336' : _rootPct >= 75 ? '#ff9800' : '#888';
|
||||
// The suffix belongs to a real figure. "— in RAM" reads as a measurement that came back
|
||||
// empty rather than one that was never taken.
|
||||
const _cacheStr = vv.cache_bytes == null
|
||||
? `<span style="color:#555;">not measured</span>`
|
||||
: `${_vvSize(vv.cache_bytes)}<span style="color:#444;"> in RAM`
|
||||
+ (_rootPct != null ? ` · rootfs ${_rootPct}%` : '') + `</span>`;
|
||||
|
||||
const _dataStr = vv.data_bytes == null
|
||||
? `<span style="color:#555;">not measured</span>`
|
||||
: `${_vvSize(vv.data_bytes)}<span style="color:#444;"> on ${vvEscHtml(vv.storage || '?')}</span>`;
|
||||
|
||||
// Jobs actually running — locks whose process is alive. A stale lock is not a running job
|
||||
// and acquire_lock() clears it on the next run, so it is reported as an aside rather than
|
||||
// as a fault.
|
||||
const _jobs = vv.jobs_running ?? [];
|
||||
const _jobStr = _jobs.length === 0
|
||||
? `<span style="color:#555;">idle</span>`
|
||||
: `<span style="color:#4caf50;">${_jobs.length} running</span>`
|
||||
+ `<span style="color:#444;"> · ${vvEscHtml(_jobs.slice(0, 2).join(', '))}`
|
||||
+ (_jobs.length > 2 ? ` +${_jobs.length - 2}` : '') + `</span>`;
|
||||
const _staleStr = (vv.locks_stale ?? 0) > 0
|
||||
? `<span style="color:#3a3a3a;"> · ${vv.locks_stale} stale lock${vv.locks_stale !== 1 ? 's' : ''}</span>` : '';
|
||||
|
||||
// Conf sync freshness. An age climbing past its schedule means the mesh has stopped talking,
|
||||
// which no other row on this page would show.
|
||||
const _confAge = vv.conf_age_sec;
|
||||
const _confStr = _confAge == null ? `<span style="color:#555;">none cached</span>`
|
||||
: `<span style="color:${_confAge > 172800 ? '#ff9800' : '#888'};">${_vvAge(_confAge)} ago</span>`;
|
||||
|
||||
document.getElementById('vv-system-body').innerHTML =
|
||||
`<div style="display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:8px;">
|
||||
<div style="min-width:0;">
|
||||
@@ -988,6 +1037,18 @@ function vvPollMonitor(live) {
|
||||
<span style="color:#444;">Load</span> <span style="color:${_loadColor};">${_loadStr}</span>
|
||||
<span style="color:#444;">Running</span> <span style="color:#888;">${_runningCtrs} ctr${_runningCtrs !== 1 ? 's' : ''}${_runningVMs > 0 ? ` · ${_runningVMs} VM` : ''}</span>
|
||||
<span style="color:#444;">Version</span> <span style="color:#3a3a3a;">${ver}</span>
|
||||
</div>
|
||||
<!-- Varaverk's own figures, ruled off from the host's. Same grid so the labels line up,
|
||||
separate block so it reads as a different subject rather than more of the same. -->
|
||||
<div style="border-top:1px solid #1e1e1e;margin-top:8px;padding-top:7px;">
|
||||
<div style="font-size:9px;color:#333;text-transform:uppercase;letter-spacing:.07em;margin-bottom:5px;">Varaverk</div>
|
||||
<div style="display:grid;grid-template-columns:auto 1fr;gap:3px 8px;font-size:11px;">
|
||||
<span style="color:#444;">Cache</span> <span style="color:${_cacheColor};">${_cacheStr}</span>
|
||||
<span style="color:#444;">Data</span> <span style="color:#888;">${_dataStr}</span>
|
||||
<span style="color:#444;">Jobs</span> <span>${_jobStr}${_staleStr}</span>
|
||||
<span style="color:#444;">Conf</span> <span>${_confStr}</span>
|
||||
<span style="color:#444;">Build</span> <span style="color:#3a3a3a;font-family:monospace;">${vvEscHtml(vv.commit || '—')}</span>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
// ── Partner ──────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user