Commit Graph

126 Commits (7276e963eb08a0f0b4bddbea38b4a13a442d4218)

Author SHA1 Message Date
Antoine Jacoutot 7276e963eb cpu: implement Mhz and Cores
Adapted from the FreeBSD code.
Successfully tested with Nomad.
6 years ago
Lomanic 5f8353c741 [cpu][openbsd] Fix #621, define CPU states according to OpenBSD version 6 years ago
marcospedreiro f0ebb60b86 handle pr comments: use assert.InEpsilon 6 years ago
marcospedreiro d47801b68b revert imports 6 years ago
marcospedreiro 3cc34ebf18 windows cpu time (true) should return cpu time not percentages 6 years ago
marcospedreiro 45aeaebda5 test windows cpu.Time(true) returning time instead of percentages 6 years ago
Lomanic 4254ce2081
Merge pull request #601 from Lomanic/issue551
Fix #551 Filter out '_Total' results from PerfInfoWithContext and unexport this function.

Also propagate context in perCPUTimes (renamed to perCPUTimesWithContext) and unexport Win32_PerfFormattedData_Counters_ProcessorInformation type.
6 years ago
Lomanic 79f8a73e23 Fix #551 Filter out '_Total' results from PerfInfoWithContext and unexport this function
Also propagate context in perCPUTimes (renamed to perCPUTimesWithContext)
and unexport Win32_PerfFormattedData_Counters_ProcessorInformation.
6 years ago
shirou a11c78ba2c
Merge pull request #581 from CMGS/master
get docker container cpu usage from cpuacct.usage
7 years ago
Iskander Sharipov f3d4342c30 cpu,process: remove commented-out code
Found using https://go-critic.github.io/overview#commentedOutCode-ref
7 years ago
CMGS d93c01e54d get docker container cpu usage from cpuacct.usage 7 years ago
Michal Rostecki 7c7dec96c6 cpu: Check for error object 7 years ago
shirou 145dca90f7 change to use CommandContext. 7 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 32a44bdc39
Merge pull request #488 from sadag/master
windows: fix WithContext functions
7 years ago
shirou 9a74b6fe2e [cpu]windows: fix retrun value. 7 years ago
sada 8dd42707e2 windows: fix WithContext functions
set timeout only if parent context doesn't set.
7 years ago
Jaime Fullaondo 178e5ce997 [host] fix race condition to ret 7 years ago
shirou 4c73494c78 Add WithContext functions. 7 years ago
Adam Medzinski 22f3299fd7
Add missing doc for cpu.TimesStat structure 7 years ago
leaf 65598d98cc To prevent hang if wmi.Query hangs, add a context-aware wrapper for it. 7 years ago
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.
8 years ago
WAKAYAMA Shirou 4c9fd1f200 [cpu]linux: add testcode with testdata. 8 years ago
HeChuan c818f7b647 set win cpu total name to "cpu-total"
set the name of windows cpu total percent to "cpu-total"
keep the same with Linux, Freebsd system
8 years ago
Andrew Danforth 484470889f Only read /proc/stat once when cpu.Times(true) is called on Linux 8 years ago
shirou 3dd8bd46d9 Merge pull request #376 from ContinuumLLC/win_percpu_feature
Windows: Read processor performance metrics overall, per cpu and per core
8 years ago
Rajkumar Gupta b657e83fed Added comments for structs and functions 8 years ago
Rajkumar Gupta 2d2db4203f Change to adapt current cpu.Times API for per cpu and core time stats 8 years ago
Sean Chittenden 635b971c0e
Move from the `syscall` package to the `golang.org/x/sys/{unix,windows}` 8 years ago
Rajkumar Gupta ea683cd370 Read processor performance metrics per cpu and per core 8 years ago
WAKAYAMA shirou b6da2bd76e [freebsd] cpu: fix CPUInfo on 10.3R
Related: #307
8 years ago
WAKAYAMA Shirou dfbb3e40da fix build bugs. 8 years ago
Jakob Gillich facb241c12 clarify return value of cpu.Percent() 8 years ago
WAKAYAMA Shirou 3499dec5c0 [cpu]linux: handle hz values by tmm1 8 years ago
WAKAYAMA Shirou a63f1aeeec use Processor entry as model name fallback by @tmm1 8 years ago
WAKAYAMA Shirou 36b408780c cpu[linux]: ignore cpufreq/cpuinfo_max_freq error 8 years ago
WAKAYAMA Shirou bad1ce0748 fix typo 8 years ago
WAKAYAMA Shirou 30ebb9ca3a rename expected dir to testdata. 8 years ago
WAKAYAMA Shirou f8ef680a47 error strings change to lowercase 8 years ago
shirou d4c8874c19 Merge pull request #328 from jen20/solaris-cpu
cpu: Implement Solaris support for Info()
8 years ago
James Nugent 49ed700c0d cpu: Implement Solaris support for Info()
This commit adds Solaris(^1) support for the Info() function of package
cpu, with the exception of the L2 cache size which is not trivially
available(^2).

Support is implemented by parsing the output of `isainfo -b -v` (for the
instruction set flags), and `psr-info -p -v` for other information.
Example outputs from a range of different size VMs and Joyent containers
are included as part of the tests.

(^1): This has only been tested with Illumos in the form of SmartOS. I
believe it to be portable to other Illumos distributions but have not
tested on Oracle Solaris.

(^2): Enough support is added here to be usable for my port of
HashiCorp's Nomad to SmartOS.
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
Sam Kleinman 915d1e930e fix panic in starvation situations 8 years ago
shirou 77b5d0080a Merge pull request #311 from sparrc/cpu-times-panic
fix panic when /proc/stat is empty
8 years ago
Cameron Sparr 0c9a1d33cb
fix panic when /proc/stat is empty
don't really know why this would be the case, but I suppose there are
always edge-cases.

see https://github.com/influxdata/telegraf/issues/2356
8 years ago
Cameron Sparr a213bf5e6d
run go fmt ./... 8 years ago
WAKAYAMA shirou dc8102185d separate freebsd specific test code. 8 years ago
WAKAYAMA shirou a54f700f00 fix test other than freebsd. 8 years ago
WAKAYAMA shirou eb5bfca902 [cpu]freebsd: cpu.Info() now returns CPUInfos same number as CPU nums. 8 years ago
WAKAYAMA shirou 7783018b9d [cpu]freebsd: CPU.CPU now indicates CPU num instead of MHz. 8 years ago