-
Notifications
You must be signed in to change notification settings - Fork 41
Add luacpu module #318
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
Add luacpu module #318
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds CPU information query capabilities to the lualinux module by introducing two new functions: nproc() to get the number of online CPUs and cpustat() to retrieve detailed time statistics for individual CPUs.
- Added
nproc()function returning the number of online CPUs - Added
cpustat()function for fetching per-CPU time statistics (user, system, idle, etc.) - Included example demonstrating usage of the new functions
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/lualinux.c | Implements the new nproc and cpustat functions with appropriate documentation, validation, and kernel API integration |
| examples/cpustat.lua | Provides a working example that demonstrates how to query and display CPU statistics for all online CPUs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lneto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks good to me if you want to merge without the example..
2df93de to
f021ac6
Compare
lneto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you just rename the PR's title? Thus, I can merge it. Thanks!
This is my first attempt to collaborate with lunatik in an topic I have interest that's metrics collection.
I'm starting with a simple
luacpu, so I can get some feedback.