feat(host_agent): NFS delay per mount, read from /proc/self/mountstats (#5996)
Each sample carries each NFS mount's requests since the last one: how many
a second, their round trip and execute time (READ and WRITE on their own),
and how many were sent again or hit a major timeout. mountstats is the
kernel's own count and never touches the share, so it reads while one is
stuck. Steward stores them per mount and the slowest on the host as
nfs_exe_max_ms, for an "NFS slow" rule and the host page's NFS chart beside
mounts_stalled; each mount's bar says what a request took.
Agent 1.22.0 (which also carries the backlog order from 41fc807).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -21,10 +21,20 @@ SOURCE_MODULE = "host_agent"
|
||||
HISTORY_METRICS = (
|
||||
"cpu_pct", "mem_used_pct", "disk_used_pct_worst", "load_1m",
|
||||
"net_rx_bps", "net_tx_bps", "disk_read_bps", "disk_write_bps",
|
||||
"temp_c_max", "psi_mem_some_avg10",
|
||||
"temp_c_max", "psi_mem_some_avg10", "nfs_exe_max_ms", "mounts_stalled",
|
||||
)
|
||||
|
||||
|
||||
async def has_nfs(session, host_name: str) -> bool:
|
||||
"""Whether the host's agent has reported an NFS mount's delay (#5996)."""
|
||||
from steward.models.metrics import PluginMetricLatest
|
||||
return (await session.execute(
|
||||
select(PluginMetricLatest.metric_name).where(
|
||||
PluginMetricLatest.source_module == SOURCE_MODULE,
|
||||
PluginMetricLatest.resource_name.startswith(host_name + ":"),
|
||||
PluginMetricLatest.metric_name == "nfs_ops_per_sec").limit(1))).first() is not None
|
||||
|
||||
|
||||
async def _latest_metrics_for_host(session, host_name: str) -> dict[str, dict[str, float]]:
|
||||
"""{resource_name: {metric: value}} — latest sample per (resource, metric) for
|
||||
a host + its sub-resources, from plugin_metric_latest (#5208). A host whose
|
||||
|
||||
Reference in New Issue
Block a user