Cache the watchdog payload, and stop reading trailing comments as conf values
The tab collected over SSH on every 30s poll — 8.3s a load with HOST2 down. vv_parse_conf_scalar() captured to end of line, so a commented toggle parsed as "true # HOST2 back online": every threshold read right because (int) stops at the first non-digit, and 38 booleans read wrong. The Fallback tab has been showing failover disabled while it was on.
This commit is contained in:
@@ -147,5 +147,12 @@ vv_cache_write('monitor', $monitor);
|
||||
$arrs = vv_arrs_all();
|
||||
vv_cache_write('arrs', $arrs);
|
||||
|
||||
// ── Watchdog payload ──────────────────────────────────────────────────────────
|
||||
// Here for the same reason as the other two: vv_wd_all() SSHes to every partner, which cost 8.3s
|
||||
// on this host with HOST2 down, and the Watchdog tab polls every 30 seconds. Collected off the
|
||||
// request path it is paid once a minute by cron instead of by whoever has the tab open.
|
||||
require_once $_base . '/include/watchdog.php';
|
||||
vv_cache_write('watchdog', vv_wd_all());
|
||||
|
||||
$elapsed = round((microtime(true) - $t) * 1000);
|
||||
echo "Cache written in {$elapsed}ms — monitor + arrs\n";
|
||||
echo "Cache written in {$elapsed}ms — monitor + arrs + watchdog\n";
|
||||
|
||||
Reference in New Issue
Block a user