Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Render Machines disk I/O detail tooltip
rcourtman751457b0b3e0
diff --git a/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx b/frontend-modern/src/features/standalone/AgentsMachinesTable.tsxindex 0030267994..c3a5c2a345 100644--- a/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx+++ b/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx@@ -36,7 +36,7 @@ import {import { useColumnVisibility } from '@/hooks/useColumnVisibility';import type { Disk } from '@/types/api';import type { Resource, ResourceAvailabilityMeta } from '@/types/resource';-import { formatSpeed, normalizeDiskArray } from '@/utils/format';+import { formatBytes, formatSpeed, normalizeDiskArray } from '@/utils/format';import { buildMetricKeyForUnifiedResource } from '@/utils/metricsKeys';import {getRaidDeviceBadgeClass,@@ -50,6 +50,7 @@ import { getWorkloadsGuestNetworkEmptyState } from '@/utils/workloadGuestPresentimport {AGENT_MACHINE_COLUMNS,getAgentMachineCpuPercent,+ getAgentMachineDiskIODetails,getAgentMachineDiskIOTotal,getAgentMachineIpValues,getAgentMachineNetworkInterfaceDetails,@@ -65,6 +66,7 @@ import {timestampMillisFrom,type AgentMachineColumn,type AgentMachineColumnId,+ type AgentMachineDiskIODetail,type AgentMachineNetworkInterfaceDetail,type AgentMachineRaidArrayDetail,type AgentMachineSortKey,@@ -340,6 +342,99 @@ const AgentMachineNetworkCell: Component<{);};+const AgentMachineDiskIOCell: Component<{+ diskIO: Resource['diskIO'] | undefined;+ details: AgentMachineDiskIODetail[];+ title: string;+}> = (props) => {+ const hasDetails = () => props.details.length > 0;+ const shownDetails = () => props.details.slice(0, 8);+ const hiddenDetailCount = () => Math.max(0, props.details.length - shownDetails().length);+ const ariaLabel = () => props.title.replace(/\n/g, ', ') || 'Disk I/O throughput';+ const hasCounterValue = (disk: AgentMachineDiskIODetail) =>+ disk.readBytes !== undefined ||+ disk.writeBytes !== undefined ||+ disk.readOps !== undefined ||+ disk.writeOps !== undefined ||+ disk.readTimeMs !== undefined ||+ disk.writeTimeMs !== undefined ||+ disk.ioTimeMs !== undefined;++ return (+ <AgentMachineMetricTooltip+ triggerDataAttribute="data-agent-machine-diskio-trigger"+ tooltipDataAttribute="data-agent-machine-diskio-tooltip"+ triggerClass="grid w-full grid-cols-[0.75rem_minmax(0,1fr)] grid-rows-2 items-center gap-x-1 gap-y-0.5 text-[11px] leading-tight tabular-nums"+ tooltipClass="min-w-[230px] max-w-[360px] space-y-2"+ enabled={hasDetails()}+ ariaLabel={ariaLabel()}+ title={props.title}+ maxWidth={380}+ trigger={+ <>+ <span class="inline-flex w-3 justify-center font-mono text-blue-500">R</span>+ <span class="min-w-0 truncate">{formatSpeed(props.diskIO?.readRate ?? 0)}</span>+ <span class="inline-flex w-3 justify-center font-mono text-amber-500">W</span>+ <span class="min-w-0 truncate">{formatSpeed(props.diskIO?.writeRate ?? 0)}</span>+ </>+ }+ >+ <section>+ <div class="mb-1 border-b border-border pb-1 font-semibold text-muted">Disk I/O</div>+ <div class="mb-1 grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-0.5 text-[9px]">+ <span class="font-mono text-blue-500">Read</span>+ <span class="min-w-0 truncate text-base-content">+ {formatSpeed(props.diskIO?.readRate ?? 0)}+ </span>+ <span class="font-mono text-amber-500">Write</span>+ <span class="min-w-0 truncate text-base-content">+ {formatSpeed(props.diskIO?.writeRate ?? 0)}+ </span>+ </div>+ <div class="max-h-[280px] space-y-1.5 overflow-y-auto pr-1">+ <For each={shownDetails()}>+ {(disk, index) => (+ <div class="min-w-0" classList={{ 'border-t border-border pt-1.5': index() > 0 }}>+ <div class="truncate font-semibold text-base-content" title={disk.device}>+ {disk.device}+ </div>+ <Show+ when={hasCounterValue(disk)}+ fallback={<div class="mt-0.5 text-[9px] text-muted">No device counters</div>}+ >+ <div class="mt-1 grid grid-cols-[auto_minmax(0,1fr)_auto_minmax(0,1fr)] gap-x-2 gap-y-0.5 text-[9px] text-muted">+ <Show when={disk.readBytes !== undefined || disk.writeBytes !== undefined}>+ <span class="font-mono text-blue-500">R</span>+ <span class="min-w-0 truncate">{formatBytes(disk.readBytes ?? 0)}</span>+ <span class="font-mono text-amber-500">W</span>+ <span class="min-w-0 truncate">{formatBytes(disk.writeBytes ?? 0)}</span>+ </Show>+ <Show when={disk.readOps !== undefined || disk.writeOps !== undefined}>+ <span class="font-mono text-blue-500">RO</span>+ <span class="min-w-0 truncate">{Math.round(disk.readOps ?? 0)}</span>+ <span class="font-mono text-amber-500">WO</span>+ <span class="min-w-0 truncate">{Math.round(disk.writeOps ?? 0)}</span>+ </Show>+ <Show when={disk.ioTimeMs !== undefined}>+ <span class="font-mono">IO</span>+ <span class="min-w-0 truncate">{Math.round(disk.ioTimeMs ?? 0)} ms</span>+ </Show>+ </div>+ </Show>+ </div>+ )}+ </For>+ <Show when={hiddenDetailCount() > 0}>+ <div class="border-t border-border pt-1 text-[9px] text-muted">+ +{hiddenDetailCount()} more devices+ </div>+ </Show>+ </div>+ </section>+ </AgentMachineMetricTooltip>+ );+};+const AgentMachineRaidCell: Component<{arrays: AgentMachineRaidArrayDetail[];summary: string;@@ -811,6 +906,7 @@ export const AgentsMachinesTable: Component<{const networkTotal = () => getAgentMachineNetworkTotal(machine);const networkInterfaces = () => getAgentMachineNetworkInterfaceDetails(machine);const diskIOTotal = () => getAgentMachineDiskIOTotal(machine);+ const diskIODetails = () => getAgentMachineDiskIODetails(machine);const primaryIp = () => getAgentMachinePrimaryIp(machine);const ipValues = () => getAgentMachineIpValues(machine);const raidArrays = () => getAgentMachineRaidArrayDetails(machine);@@ -943,23 +1039,11 @@ export const AgentsMachinesTable: Component<{when={canRenderMetrics() && diskIOTotal() !== undefined}fallback={metricFallback()}>- <div- class="grid w-full grid-cols-[0.75rem_minmax(0,1fr)_0.75rem_minmax(0,1fr)] items-center gap-x-1 text-[11px] tabular-nums"+ <AgentMachineDiskIOCell+ diskIO={machine.diskIO}+ details={diskIODetails()}title={diskIOTitleFor(machine)}- >- <span class="inline-flex w-3 justify-center font-mono text-blue-500">- R- </span>- <span class="min-w-0 truncate">- {formatSpeed(machine.diskIO?.readRate ?? 0)}- </span>- <span class="inline-flex w-3 justify-center font-mono text-amber-500">- W- </span>- <span class="min-w-0 truncate">- {formatSpeed(machine.diskIO?.writeRate ?? 0)}- </span>- </div>+ /></Show></TableCell></Show>diff --git a/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx b/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsxindex 292b197fbf..2ebeff5dda 100644--- a/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx+++ b/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx@@ -196,6 +196,51 @@ describe('AgentsMachinesTable', () => {expect(screen.getByText('1000 Mbps')).toBeInTheDocument();});+ it('shows structured agent disk I/O details from the Disk I/O value', async () => {+ const { container } = render(() => (+ <AgentsMachinesTable+ resources={[+ resource({+ id: 'diskio-host',+ name: 'Disk I/O Host',+ diskIO: { readRate: 4096, writeRate: 8192 },+ agent: {+ diskIO: [+ {+ device: '/dev/sda',+ readBytes: 1_048_576,+ writeBytes: 2_097_152,+ readOps: 120,+ writeOps: 240,+ ioTimeMs: 360,+ },+ ],+ },+ }),+ ]}+ emptyIcon={emptyIcon}+ emptyTitle="No machines"+ emptyDescription="Install Pulse Agent."+ />+ ));++ const trigger = container.querySelector('[data-agent-machine-diskio-trigger="true"]');+ expect(trigger).not.toBeNull();+ if (!trigger) return;++ await fireEvent.mouseEnter(trigger);++ expect((await screen.findAllByText('Disk I/O')).length).toBeGreaterThan(1);+ expect(screen.getByText('/dev/sda')).toBeInTheDocument();+ expect(screen.getAllByText('4.00 KB/s').length).toBeGreaterThan(0);+ expect(screen.getAllByText('8.00 KB/s').length).toBeGreaterThan(0);+ expect(screen.getByText('1.00 MB')).toBeInTheDocument();+ expect(screen.getByText('2.00 MB')).toBeInTheDocument();+ expect(screen.getByText('120')).toBeInTheDocument();+ expect(screen.getByText('240')).toBeInTheDocument();+ expect(screen.getByText('360 ms')).toBeInTheDocument();+ });+it('shows structured agent RAID array details from the RAID value', async () => {const { container } = render(() => (<AgentsMachinesTablediff --git a/frontend-modern/src/features/standalone/__tests__/agentMachineTableModel.test.ts b/frontend-modern/src/features/standalone/__tests__/agentMachineTableModel.test.tsindex 7a3366ba9a..5440de782e 100644--- a/frontend-modern/src/features/standalone/__tests__/agentMachineTableModel.test.ts+++ b/frontend-modern/src/features/standalone/__tests__/agentMachineTableModel.test.ts@@ -1,6 +1,7 @@import { describe, expect, it } from 'vitest';import type { Resource } from '@/types/resource';import {+ getAgentMachineDiskIODetails,getAgentMachineNetworkInterfaceDetails,getAgentMachineRaidArrayDetails,getAgentMachineTemperatureCelsius,@@ -23,6 +24,46 @@ const resource = (overrides: Partial<Resource>): Resource =>}) as Resource;describe('agentMachineTableModel', () => {+ it('normalizes agent disk I/O device counters for table inspection', () => {+ const details = getAgentMachineDiskIODetails(+ resource({+ agent: {+ diskIO: [+ {+ device: ' /dev/sda ',+ readBytes: 1024,+ writeBytes: 2048,+ readOps: 10,+ writeOps: 20,+ ioTimeMs: 30,+ },+ {+ device: ' ',+ readBytes: 0,+ writeBytes: -1,+ },+ { device: '' },+ ],+ },+ }),+ );++ expect(details).toEqual([+ {+ device: '/dev/sda',+ readBytes: 1024,+ writeBytes: 2048,+ readOps: 10,+ writeOps: 20,+ ioTimeMs: 30,+ },+ {+ device: 'disk-2',+ readBytes: 0,+ },+ ]);+ });+it('normalizes agent RAID array details for table inspection', () => {const details = getAgentMachineRaidArrayDetails(resource({diff --git a/frontend-modern/src/features/standalone/agentMachineTableModel.ts b/frontend-modern/src/features/standalone/agentMachineTableModel.tsindex 4615ec58b6..a7300c0472 100644--- a/frontend-modern/src/features/standalone/agentMachineTableModel.ts+++ b/frontend-modern/src/features/standalone/agentMachineTableModel.ts@@ -1,5 +1,5 @@import type { ColumnDef } from '@/hooks/useColumnVisibility';-import type { HostRAIDArray, HostRAIDDevice } from '@/types/api';+import type { HostDiskIO, HostRAIDArray, HostRAIDDevice } from '@/types/api';import type { Resource } from '@/types/resource';import { asTrimmedString } from '@/utils/stringUtils';@@ -139,6 +139,8 @@ export type AgentMachineNetworkInterfaceDetail = {speedMbps?: number;};+export type AgentMachineDiskIODetail = HostDiskIO;+export type AgentMachineRaidArrayDetail = HostRAIDArray;const positiveTemperature = (value: number | undefined): number | undefined => {@@ -251,6 +253,11 @@ const nonNegativeMetric = (value: number | undefined): number => {return metric !== undefined && metric > 0 ? metric : 0;};+const nonNegativeFiniteMetric = (value: number | undefined): number | undefined => {+ const metric = finiteMetric(value);+ return metric !== undefined && metric >= 0 ? metric : undefined;+};+const uniqueTrimmedValues = (values: readonly string[] | undefined): string[] => {const seen = new Set<string>();const result: string[] = [];@@ -308,6 +315,45 @@ export const getAgentMachineDiskIOTotal = (machine: Resource): number | undefinereturn (read ?? 0) + (write ?? 0);};+export const getAgentMachineDiskIODetails = (machine: Resource): AgentMachineDiskIODetail[] => {+ const diskIO = machine.agent?.diskIO ?? machine.agent?.diskIo ?? [];+ return diskIO.reduce<AgentMachineDiskIODetail[]>((details, disk, index) => {+ const device = asTrimmedString(disk.device);+ const readBytes = nonNegativeFiniteMetric(disk.readBytes);+ const writeBytes = nonNegativeFiniteMetric(disk.writeBytes);+ const readOps = nonNegativeFiniteMetric(disk.readOps);+ const writeOps = nonNegativeFiniteMetric(disk.writeOps);+ const readTimeMs = nonNegativeFiniteMetric(disk.readTimeMs);+ const writeTimeMs = nonNegativeFiniteMetric(disk.writeTimeMs);+ const ioTimeMs = nonNegativeFiniteMetric(disk.ioTimeMs);++ if (+ !device &&+ readBytes === undefined &&+ writeBytes === undefined &&+ readOps === undefined &&+ writeOps === undefined &&+ readTimeMs === undefined &&+ writeTimeMs === undefined &&+ ioTimeMs === undefined+ ) {+ return details;+ }++ details.push({+ device: device ?? `disk-${index + 1}`,+ ...(readBytes !== undefined ? { readBytes } : {}),+ ...(writeBytes !== undefined ? { writeBytes } : {}),+ ...(readOps !== undefined ? { readOps } : {}),+ ...(writeOps !== undefined ? { writeOps } : {}),+ ...(readTimeMs !== undefined ? { readTimeMs } : {}),+ ...(writeTimeMs !== undefined ? { writeTimeMs } : {}),+ ...(ioTimeMs !== undefined ? { ioTimeMs } : {}),+ });+ return details;+ }, []);+};+export const getAgentMachineTemperatureCelsius = (machine: Resource): number | undefined => {const direct = positiveTemperature(machine.temperature);if (direct !== undefined) return direct;diff --git a/frontend-modern/src/hooks/useUnifiedResources.ts b/frontend-modern/src/hooks/useUnifiedResources.tsindex 08a071c19d..0e9ae29b63 100644--- a/frontend-modern/src/hooks/useUnifiedResources.ts+++ b/frontend-modern/src/hooks/useUnifiedResources.ts@@ -79,6 +79,17 @@ type APIAgentNetworkInterface = {speedMbps?: number;};+type APIAgentDiskIO = {+ device: string;+ readBytes?: number;+ writeBytes?: number;+ readOps?: number;+ writeOps?: number;+ readTimeMs?: number;+ writeTimeMs?: number;+ ioTimeMs?: number;+};+type APIAgentSensorSummary = {temperatureCelsius?: Record<string, number>;fanRpm?: Record<string, number>;@@ -217,6 +228,8 @@ type APIResource = {swapTotal?: number;};networkInterfaces?: APIAgentNetworkInterface[];+ diskIO?: APIAgentDiskIO[];+ diskIo?: APIAgentDiskIO[];disks?: APIAgentDiskInfo[];sensors?: APIAgentSensorSummary;raid?: APIHostRAIDArray[];diff --git a/frontend-modern/src/types/resource.ts b/frontend-modern/src/types/resource.tsindex 970483b159..a514f731da 100644--- a/frontend-modern/src/types/resource.ts+++ b/frontend-modern/src/types/resource.ts@@ -9,6 +9,7 @@import type {Disk,+ HostDiskIO,HostNetworkInterface,HostSensorSummary,HostRAIDArray,@@ -534,6 +535,8 @@ export interface ResourceAgentMeta {loadAverage?: number[];memory?: Partial<Memory>;networkInterfaces?: HostNetworkInterface[];+ diskIO?: HostDiskIO[];+ diskIo?: HostDiskIO[];disks?: ResourceAgentDisk[];sensors?: HostSensorSummary;raid?: HostRAIDArray[];