New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(api): add system stats (CPU and RAM usage) to API response #1047
base: master
Are you sure you want to change the base?
Conversation
- Implement GetCPUUsage and GetRAMUsage functions in core package for fetching CPU and memory usage. - Update apiHandler to include CPU and memory usage in the API response under "stats". - Ensure thread safety in apiHandler by properly using defer for mutex unlock. - Extend frontend to display fetched CPU and RAM usage statistics. - Add tests for new core functionality ensuring correct operation of system resource usage fetching.
Can we do same without 8 new dependencies? |
- Updated `gopsutil` from v3 to v4.24.0-alpha.1 for enhanced system monitoring capabilities. - Removed `go-astits` dependency as it's no longer required. - Cleaned up `go.sum` by removing entries for unused dependencies.
This number of dependencies is necessary to support most platforms on which go2rtc can theoretically be compiled. In fact, only 1-2 dependency code is included in the binary file, depending on the OS and architecture |
What if we make support only for the main OS - Linux? Will the dependencies get a lot less complicated? |
API handler should return a unified and predictable response, regardless of the OS running |
Then there will be no such API at all inside go2rtc |
But the implementation in this PR provides unified and predictable response across OSes |
I don't want confusing dependencies inside the |
depends on #1048