refactor: update gopsutil to v4, add overall host metrics#281
Open
refactor: update gopsutil to v4, add overall host metrics#281
Conversation
- Update all import paths from github.com/shirou/gopsutil/v3 to v4 across 10 source files (disk, cpu, memory, network, stats, app, status, and host/sys_info) - Update go.mod dependency to gopsutil/v4 v4.26.3 - Bump minimum Go version to 1.24.0 (required by gopsutil v4) - Update transitive dependencies (go-sysconf, numcpus, perfstat, sys) Key improvement: disk.IOCounters() on darwin/macOS is now implemented via IOKit in gopsutil v4, resolving the 'not implemented yet' error that previously occurred on macOS. The graceful degradation code in disk.go is preserved as a safety net for unsupported platforms. Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/35abcace-ca46-4a40-8c8e-85acd8df15e2 Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
…nted yet" Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/35abcace-ca46-4a40-8c8e-85acd8df15e2 Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
Add a new 'host/overall' metric collector that computes composite system health by evaluating CPU, memory, disk capacity, and disk I/O utilization. Each subsystem is classified as green/yellow/red based on configurable thresholds (default: 70% yellow, 90% red). The overall status reflects the worst-performing subsystem, identifying the bottleneck. Event payload includes per-subsystem breakdown with status and percentage, plus the top-level status and bottleneck indicator for dashboard display. New types in core/host: - SubsystemHealth: per-subsystem status - OverallStatus: composite health with bottleneck - ClassifyHealth(): threshold-based health classification - HealthPriority(): health comparison helper Configuration (under metrics.overall): - enabled: true/false - yellow_threshold: percentage (default 70) - red_threshold: percentage (default 90) Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/4eaec09e-6e0d-4805-bcfa-cc88c0a3a028 Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
Address code review feedback: extract the 10s interval constant into a configurable IntervalSeconds field (default: 10) on the Metric struct. Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/4eaec09e-6e0d-4805-bcfa-cc88c0a3a028 Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/4eaec09e-6e0d-4805-bcfa-cc88c0a3a028 Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/35d0ec62-94eb-4e02-a560-9dc9d927e75b Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
…eck fields Remove status/bottleneck/threshold classification from the overall utilization metric - the front layer handles green/yellow/red display logic. Add network throughput (bytes/sec in+out) to complete the subsystem coverage: CPU, memory, disk capacity, disk I/O, and network. Remove now-unused types from core/host/host.go: SubsystemHealth, OverallStatus, ClassifyHealth, HealthPriority, DefaultYellowThreshold, DefaultRedThreshold. Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/35d0ec62-94eb-4e02-a560-9dc9d927e75b Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/35d0ec62-94eb-4e02-a560-9dc9d927e75b Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
Network utilization is now reported as a percentage of configured bandwidth (network_bandwidth_mbps, default 1000 Mbps). Uses max(in, out) throughput relative to bandwidth, consistent with all other subsystems reporting used_percent in the overall metric. Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/bb90d5d0-209f-47c0-b000-9550e3005071 Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
…ion percentages Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/bb90d5d0-209f-47c0-b000-9550e3005071 Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
medcl
April 19, 2026 06:18
View session
The file is already in .gitignore but was still being tracked. This removes it from the index so future changes are properly ignored. Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/314530fc-4e7a-4937-be8f-3aa2679ba12a Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
Restore the file with N/A placeholder values instead of removing it from tracking entirely. The file remains in .gitignore so local build-regenerated values won't be accidentally committed. Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/5c37d476-1ae1-4466-963d-56cec89b93a3 Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
…it tracking Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/5c37d476-1ae1-4466-963d-56cec89b93a3 Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
The file should remain gitignored as it's regenerated during builds with build-specific values (commit hashes, timestamps). Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/4f289f27-76e1-42f7-a474-d0f40cf1c518 Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/2358e99f-f923-489e-9eca-d8a129cc20a4 Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/ffb7d4c4-0bd7-4667-a1d8-6272e617083a Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/510abe92-44c8-49b4-81fa-cb87020192a8 Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
…urable thresholds Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/98216f64-3a01-498c-b96c-6e38b2165078 Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/f607a8bf-6f7a-4789-bb63-70e325d721e2 Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
…eneck detection Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/afb21bb5-dc0e-4ba7-ad9d-7cd2a46301a5 Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/e4b60d91-9418-4dd1-b1c6-48a1d2af1d24 Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/e4b60d91-9418-4dd1-b1c6-48a1d2af1d24 Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/e4b60d91-9418-4dd1-b1c6-48a1d2af1d24 Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
…erged yet) Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/a9bec310-e8f6-4450-a151-a50df33c6d0e Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
Agent-Logs-Url: https://github.com/infinilabs/framework/sessions/824024d6-07bb-4d43-8769-c17fbf573deb Co-authored-by: medcl <64487+medcl@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes Summary
disk_io.devices: Map of device name -> utilizationdisk_io.bottleneck_device: Name of the most utilized disknetwork.devices: Map of interface name -> {used_percent, bandwidth_mbps}network.bottleneck_device: Name of the most utilized interfacedisk_io:nvme0n1,network:eth0)