1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-26 13:48:59 +08:00

27 Commits

Author SHA1 Message Date
shirou
bc060cc227 add SPDX License, remove old build tag, and replace import 2024-05-28 22:27:17 +09:00
mmorel-35
1e6b445a8a gofumpt 2021-12-22 21:54:41 +00:00
shirou
0969c9436b delete v2 directory, move v3 to top #1078 2021-11-30 23:47:59 +00:00
Tobias Klauser
ee12f66e4d cpu, v3/cpu: use sysconf package instead of exec'ing getconf
Currently, ClocksPerSec is determined by exec'ing getconf in func init,
i.e. on startup of every program importing the package. getconf might
not be present on some systems or is not executable by the current user.
To avoid this hard to control dependency, use the
github.com/tklauser/go-sysconf package which implements sysconf(3)
entirely in Go without cgo. The package is supported on all platforms
currently supported by the cpu and v3/cpu package of gopsutil.
2021-02-19 12:20:10 +01:00
Segflow
86c7289ccc Fix: use filename in exec.LookPath instead of full path
exec.LookPath searches for the file in the $PATH, which mean giving it an absolute path is against it's own purposes.
2019-05-05 20:45:07 +01:00
Lomanic
c0ca431bf1 [cpu][linux] Add support for logical arg in Counts #640 #628 2019-03-03 14:44:21 +01:00
shirou
4c73494c78 Add WithContext functions. 2017-12-31 15:25:49 +09:00
Steven Hartland
6450c60b61 Eliminate use of sysctl command on FreeBSD
In order to improve performance and help prevent crashes due to the outstanding fork crash bug:
https://github.com/golang/go/issues/15658

Replace string parsed values from the sysctl command with native reads of sysctl values using unix.SysctlRaw and unix.SysctlUint32.

This also merges OpenBSD and FreeBSD load implementations which are identical.
2017-10-05 08:45:56 +01:00
WAKAYAMA shirou
b6da2bd76e [freebsd] cpu: fix CPUInfo on 10.3R
Related: #307
2017-05-10 11:47:26 +09:00
WAKAYAMA Shirou
f8ef680a47 error strings change to lowercase 2017-03-15 22:43:20 +09:00
WAKAYAMA shirou
eb5bfca902 [cpu]freebsd: cpu.Info() now returns CPUInfos same number as CPU nums. 2017-01-29 01:23:21 +09:00
WAKAYAMA shirou
7783018b9d [cpu]freebsd: CPU.CPU now indicates CPU num instead of MHz. 2017-01-22 22:31:05 +09:00
shirou
5c1bfed855 Merge pull request #219 from sean-/freebsd-cpu-info
Improve FreeBSD's CPU InfoStat collection
2016-06-17 17:26:08 +09:00
Sean Chittenden
14b2ce8b81
Don't be lossy re: CPU model number. 2016-06-16 19:32:49 -07:00
Sean Chittenden
606680edc5
Improve the accuracy of CPU detection on FreeBSD. 2016-06-16 19:25:27 -07:00
Sean Chittenden
d2ca7e8d2c
Remove redundant build tag 2016-05-20 10:04:58 -04:00
Shirou WAKAYAMA
57f6aebc7e add Timeout to invoke command and use common.Invoke refs: #201 2016-05-20 17:59:41 +09:00
Shirou WAKAYAMA
d21ed2b40d search path via exec.LookPath before actual invoke. 2016-04-01 22:13:05 +09:00
Shirou WAKAYAMA
ea152ea901 [BREAKING CHANGE] rename functions to pass golint. ex) net.NetIOCounters -> net.IOCounters 2016-03-22 23:09:12 +09:00
Shirou WAKAYAMA
7288e9a5af common[all]: add internal 2015-10-20 00:04:57 +09:00
WAKAYAMA shirou
4bc631921f cpu: fix command output trim problem. 2015-07-17 21:52:43 +09:00
Shirou WAKAYAMA
8c17a750c6 get CLOCK TICK by using getconf. 2015-07-17 21:46:26 +09:00
WAKAYAMA shirou
b8dc51929a forget to change float32 to float64 2015-02-15 20:48:29 +09:00
Shirou WAKAYAMA
4b5bf22b88 change CPUTimes type from float32 to float64 to resolve precision issue. 2015-02-13 22:45:12 +09:00
Shirou WAKAYAMA
13cd195a7e change package name. 2014-12-30 22:09:05 +09:00
WAKAYAMA shirou
d11680c773 fix bugs on FreeBSD. 2014-11-27 10:25:14 +09:00
Shirou WAKAYAMA
a4671fcc2a move subdirectories. refer to issue #24 2014-11-27 10:18:15 +09:00