feat: implement GPU usage monitoring for macOS#1035
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements GPU usage monitoring for macOS by integrating with the IOReport framework. It replaces the stub implementation with a functional system that samples GPU performance states in a background thread and caches the results for efficient access.
Changes:
- Adds IOReport FFI bindings to interact with macOS GPU performance state APIs
- Implements a background thread that continuously samples GPU usage at 1-second intervals
- Provides thread-safe caching of GPU usage values using atomics
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src-tauri/src/platform/macos/mod.rs | Integrates new GPU module and replaces stub implementation |
| src-tauri/src/platform/macos/gpu.rs | Platform layer that initializes sampler thread and retrieves cached GPU usage |
| src-tauri/src/infrastructure/providers/macos/mod.rs | Exports new gpu and io_kit modules |
| src-tauri/src/infrastructure/providers/macos/io_kit/mod.rs | Module declaration for io_report |
| src-tauri/src/infrastructure/providers/macos/io_kit/io_report.rs | FFI bindings and implementation for IOReport sampling |
| src-tauri/src/infrastructure/providers/macos/gpu.rs | Infrastructure layer managing background sampling thread and atomic storage |
| src-tauri/Cargo.toml | Adds core-foundation dependency for macOS |
| src-tauri/Cargo.lock | Updates dependency lockfile with core-foundation 0.10.1 |
| docs/THIRD_PARTY_NOTICES/manual/macmon.mdx.md | Adds MIT license attribution for macmon project reference |
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.
No description provided.