cboxdk/system-metrics
Get real-time system metrics from Linux and macOS in pure PHP. No extensions or dependencies—just type-safe, readonly classes covering CPU, memory, storage, network, load, uptime, and container metrics with explicit Result-based error handling.
Result<T> pattern and immutable DTOs are clean but differ from Laravel’s exception-heavy conventions, so a thin adapter is required. Container/cgroup awareness is valuable for Laravel workloads running in Docker or Kubernetes. No service provider, config publishing, or Laravel facade is included; the static SystemMetrics:: API is not a Laravel facade./proc//sys requires no root but can be blocked by hardened containers, masked procfs, or disabled exec on macOS. Integration effort is moderate: wrapper, config, caching, auth middleware, failure handling, and feature flags must be built by us.int to float, so API stability should not be assumed. Parsing /proc and cgroup v1/v2 is inherently environment-sensitive. Metrics semantics, such as CPU deltas, load-average normalization, and utilization values exceeding 100%, can be misinterpreted by product and alerting consumers. Long-running Laravel Octane/queue processes may be affected by static caching. Security review is needed for host metric exposure and command execution paths.exec-style calls permitted on macOS and in production containers? How will we isolate vendor risk if the package is abandoned? Does it behave correctly under Octane and long-running queue workers? Who owns the wrapper, runbook, and fallback path?SystemMetricsProvider interface, publishes config for enabled metrics, cache TTL, sampling interval, and access control. Expose via authenticated admin/health endpoints, scheduled metrics:snapshot commands, or a custom Pulse card/exporter. Queue workers and containerized services can use limits data for capacity tuning.Result<T> failures into logs, degraded health responses, or null-safe DTOs at the boundary. If replacing shell scripts or cloud-agent metrics, run both in parallel for at least one sprint and compare outputs before cutover. Pin the exact package version initially./proc or /sys, masked procfs, permission denial, unmounted cgroups, missing sysctl, disabled exec, malformed kernel files, and container-runtime changes. The Result<T> pattern should prevent uncaught exceptions, but callers must handle failures explicitly. CPU deltas require two snapshots; first samples may be null or invalid. Utilization may exceed 100% in v3, so alert thresholds and UI displays must cap or annotate values. Public exposure of host metrics creates information-disclosure risk.How can I help you explore Laravel packages today?