Commit Graph

35 Commits (master)

Author SHA1 Message Date
Matthieu MOREL 7e19b35f50 enable all rules of perfsprint linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
3 months ago
shirou bc060cc227 add SPDX License, remove old build tag, and replace import 10 months ago
shirou d1cc7d2125 fix(cpu): fix cpu total and busy calc 3 years ago
Matthieu MOREL 8ba220d241 enable contextcheck linter 3 years ago
mmorel-35 1e6b445a8a gofumpt 3 years ago
shirou 0969c9436b delete v2 directory, move v3 to top #1078 3 years ago
ninedraft 34df4904f6 use cancelable sleep in cpu.PercentWithContext and process.Process.PercentWithContext 5 years ago
renaynay 5e1b882e37
updated docs for TimesStat with correct time unit 5 years ago
alialaee b8f51de8f6 Fix #777 cpu.Total should not add Guest and GuestNice 5 years ago
shirou 86fdae99e1 [cpu]: return 100 instead 1 if t1 are bigger than t2 6 years ago
Lomanic 946c9ce6ea [cpu] Fix #599 cap percent values returned by Percent() between 0 and 100
See https://github.com/shirou/gopsutil/issues/599#issuecomment-491942842 for a repoduction case
6 years ago
shirou cae8efcffa [cpu]: remove unused field Stolen
see #676
6 years ago
Lomanic c0ca431bf1 [cpu][linux] Add support for logical arg in Counts #640 #628 6 years ago
Laurie Clark-Michalek 413cb32b6c Use static initialisation for invoke instances, instead of init funcs
The order of init function execution is dependant on the order that the
source files are passed to the compiler. This causes issues when
building under other build systems, such as bazel or buck, as they are
not guarenteed to maintain the same file order as the default go tool.
7 years ago
shirou 4c73494c78 Add WithContext functions. 7 years ago
Adam Medzinski 22f3299fd7
Add missing doc for cpu.TimesStat structure 7 years ago
Jakob Gillich facb241c12 clarify return value of cpu.Percent() 8 years ago
WAKAYAMA Shirou f8ef680a47 error strings change to lowercase 8 years ago
Simarpreet Singh 5a4c90ad5f cpu: Expose CPU microcode information
This commit exposes the CPU microcode information.

Signed-off-by: Simarpreet Singh <simar@opendns.com>
8 years ago
Hilko Bengen 832dcb96c8 cpu.Percent (Windows): Use the same implementation as on Unix
WMI is way too slow.
9 years ago
Ben Aldrich a76195e088 fixed imports and spelling error 9 years ago
Ben Aldrich c36f7ac8b0 rename var 9 years ago
Ben Aldrich fcc1747d9f Merge branch 'master' of https://github.com/shirou/gopsutil into calc_cpu_percent
Conflicts:
	cpu/cpu.go
9 years ago
Ben Aldrich c389989453 calculate cpu percentage compared to last call if 0 interval is given 9 years ago
Shirou WAKAYAMA 57f6aebc7e add Timeout to invoke command and use common.Invoke refs: #201 9 years ago
Shirou WAKAYAMA 4bb84648bf JSON representation is renamed to fit Google JSON style, camelCase. 9 years ago
Shirou WAKAYAMA ea152ea901 [BREAKING CHANGE] rename functions to pass golint. ex) net.NetIOCounters -> net.IOCounters 9 years ago
Johan Walles ebaa641e63 Make a public function for computing total CPU time
This function used to be a private part of process.go.

Since I needed that functionality however I think it's better to make it public
than for me to copy it into my own code.

As a side effect of this change, I also fixed a bug in the function where Stolen
was not part of the sum. Having the function close to the CPUTimesStat
declaration will make problems like this less likely to re-occur in the future.
9 years ago
Ryan J. O'Neil 2434a327b9 Removing race condition in CPUPercent calculation. 9 years ago
WAKAYAMA Shirou ead8393137 cpu: use wmic to get CPU usage on Windows. 10 years ago
Shirou WAKAYAMA 753ea1bb48 fix when converting CPUTimes to JSON, sometimes idel have exponent 10 years ago
Shirou WAKAYAMA 4b5bf22b88 change CPUTimes type from float32 to float64 to resolve precision issue. 10 years ago
Shirou WAKAYAMA 13cd195a7e change package name. 10 years ago
Shirou WAKAYAMA 16de570414 merge 039b9defab 10 years ago
Shirou WAKAYAMA a4671fcc2a move subdirectories. refer to issue #24 10 years ago