-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Provide a generic sysinfo function #720
Comments
Would like to work on it. BR, -----Original Message----- This is supposed to be a function returning generic system wide info designed to host information which is not cross platform As such, the returned namedtuple will have different attributes depending on what platform we're on Some ideas: |
I'd rather ask people to come up with ideas about what else we might provide first. Of course any implementation help / PR is welcome. |
As for Windows Process Hacker is able to determine number of context switches, interrupts and system calls. Hopefully psutil should be able to do the same. |
What you want is SYSTEM_PERFORMANCE_INFORMATION and SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, which you can get using NtQuerySystemInformation. See phlib/include/ntexapi.h and PhSipTickCpuDialog in ProcessHacker/sysinfo.c for details. |
Note: for Linux testing we can use:
|
libstatgrab has a lot of useful stuff: https://github.com/i-scream/libstatgrab/blob/master/src/libstatgrab/cpu_stats.c |
Any head up concerning this development request ? |
This is currently not on my radar for the immediate future. |
This is supposed to be a function returning generic system wide info designed to host information which is not cross platform. As such, the returned namedtuple will have different attributes depending on what platform we're on. The new API should be called
psutil.sysinfo()
. Some ideas:Linux
psutil/psutil/_pslinux.py
Line 470 in 905030b
cat /proc/sys/fs/file-nr
)sysctl -a | grep fs.file-max
)FreeBSD
psutil/psutil/arch/bsd/freebsd.c
Line 997 in 905030b
OpenBSD
psutil/psutil/arch/bsd/openbsd.c
Line 801 in 905030b
NetBSD
https://github.com/giampaolo/psutil/blob/905030b052414e66bc065fc6dff14dbd875be77a/psutil/arch/bsd/netbsd.c#L801
OpenBSD
psutil/psutil/_psutil_osx.c
Line 1793 in 905030b
Solaris
psutil/psutil/_psutil_sunos.c
Line 1282 in 905030b
Windows
?
Debatable
last_pid
/proc/sys/kernel/ns_last_pid
sysctl kern.lastpid
max_threads_perproc
: (debatable becauseresource
module can be used)sysctl kern.threads.max_threads_per_proc
max_files_perproc
: (debatable becauseresource
module can be used)sysctl kern.maxfilesperproc
Ideas are very welcome.
The text was updated successfully, but these errors were encountered: