You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 26, 2026. It is now read-only.
repeated chart empty states, stat-card shells, and time-label formatting;
separate conventions for limits and sampling windows for the same historicalMetrics API.
The resource and server dashboards aggregate different data and should retain feature-specific transformation logic. The low-level formatting, time-range model, and chart presentation are nevertheless duplicated and already produce inconsistent output.
Reviewed against master at release commit 56c78fb6bbc3c3aacfafb4355288383f9946def5.
Proposed consolidation
Add shared metric formatters for bytes, percentages, durations/uptime, rates, and safe numeric coercion.
Define one typed time-range catalog and a resolver returning start time, display label, and recommended query/sample limits.
Extract a reusable monitoring area-chart primitive supporting one or more series, units, dimensions, empty copy, and accessible summaries.
Extract a small stat-card primitive if its repeated presentation remains stable after comparing current consumers.
Keep resource-specific container bucketing and server-specific host metric transformation in their feature modules.
Standardize timezone and label generation for one-hour, six-hour, 24-hour, and seven-day windows.
Document when byte values are binary units and when metrics are already supplied in provider-specific units.
Add unit tests for formatters and component tests for charts rather than testing the same behavior in every page.
Acceptance criteria
Only one app utility formats byte quantities for dashboard metrics.
Monitoring pages consume one shared typed range definition.
Summary
The monitoring dashboard, resource monitoring tab, and Docker inventory independently implement overlapping metrics utilities and visualization code.
Confirmed duplication includes:
formatBytesimplementations, with different zero labels and decimal behavior;finite,numberValue);ResponsiveContainer/AreaChart/ axis / tooltip / area configuration;historicalMetricsAPI.The resource and server dashboards aggregate different data and should retain feature-specific transformation logic. The low-level formatting, time-range model, and chart presentation are nevertheless duplicated and already produce inconsistent output.
Reviewed against
masterat release commit56c78fb6bbc3c3aacfafb4355288383f9946def5.Proposed consolidation
Acceptance criteria
Representative affected files
apps/web/src/app/(dashboard)/monitoring/page.tsxapps/web/src/features/resources/components/monitoring-tab.tsxapps/web/src/app/(dashboard)/docker/page.tsxapps/web/src/lib/metrics.tsapps/web/src/components/shared/monitoring-chart.tsx