Commit Graph

47 Commits (ca71a6db3c7495189bdc01e2235e79175cfd5bd2)

Author SHA1 Message Date
Tobias Klauser f2bf9a480a
cpu: use windows.GetActiveProcessorCount
Use GetActiveProcessorCount and the ALL_PROCESSOR_GROUPS const provided
in golang.org/x/sys/windows. The function is available on Windows 7 and
later. Go requires Windows 7, see https://go.dev/doc/go1.11#ports
2 years ago
mmorel-35 1e6b445a8a gofumpt 3 years ago
mmorel-35 eb5f6203d8 gofmt 3 years ago
shirou d2e27c1712 fix dependabot v2 deletion. 3 years ago
shirou 0969c9436b delete v2 directory, move v3 to top #1078 3 years ago
shirou 0fdf65fa3e Change to use yusufpapurcu/wmi from StackExchange/wmi. 3 years ago
Huan Wang 6a572952f0 fix slow cpuinfo on multisocket config
updated win32_Processor struct to exclude loadpercentage field.
The loadpercentage takes linearly more time as the # of sockets
increases. By default vSphere maps 1 vCPU to 1 socket, resulting in very
poor performance when getting CPU info against, saying, 40 vCPU VM
(basically 40 sockets as seen by the VM).
4 years ago
renaynay 0e9462eed2
renamed CLK_TCK variables for consistency across OSs 5 years ago
Lomanic 71adb75383 [cpu][windows] Add support for logical arg in Counts #640 #628 6 years ago
Lomanic e6aa38bec2 [cpu][windows] WIP Add support for logical arg in Counts #640 #628 6 years ago
Lomanic c0ca431bf1 [cpu][linux] Add support for logical arg in Counts #640 #628 6 years ago
nikita-vanyasin 59b002e5c2 Fix function naming 6 years ago
nikita-vanyasin 4ef0ddafc7 Eliminate WMI queries when calling cpu.Times with percpu=True
based on e89f2c5fad/internal/monitors/cpu/cpu_windows.go
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 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 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
leaf 65598d98cc To prevent hang if wmi.Query hangs, add a context-aware wrapper for it. 7 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
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
Hilko Bengen 832dcb96c8 cpu.Percent (Windows): Use the same implementation as on Unix
WMI is way too slow.
9 years ago
Shirou WAKAYAMA 613a8a90e1 fixed by golint. 9 years ago
Shirou WAKAYAMA ea152ea901 [BREAKING CHANGE] rename functions to pass golint. ex) net.NetIOCounters -> net.IOCounters 9 years ago
Shirou WAKAYAMA 7288e9a5af common[all]: add internal 10 years ago
Ben Aldrich a4ec4177a6 Fix cpu percent on windows
Tested on windows 7:

When divided by 100 you get cpu percentage of  %0.14 when task manager shows %14. Once this is removed they match.
10 years ago
WAKAYAMA Shirou 4696985e84 cpu[windows]: skip if could not get cpu.LoadPercentage. 10 years ago
mayowa 6fa0704dbf fixed: ProcessorId doesnt return a value 10 years ago
mayowa 7889ce3e03 changed ProccessorId type to *string, cause wmi sometimes returns nil for it 10 years ago
mayowa 6a2bc5afe8 removed l2CacheSize as its not present in all wmi databases 10 years ago
WAKAYAMA shirou 64357f04e7 use StackExchange/wmi instead of invoking wmic process.
Note: This may not work on some old Windows XP.
10 years ago
WAKAYAMA Shirou 5f8b99aa65 windows: GetWmic returns [][]string where string split by "," 10 years ago
Shirou WAKAYAMA 170390c0df cpu: fix build option on unix. 10 years ago
WAKAYAMA Shirou ead8393137 cpu: use wmic to get CPU usage on Windows. 10 years ago
WAKAYAMA Shirou 4694ce0e4d cpu: use wmic to get CPUInfo on Windows 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
WAKAYAMA Shirou 9f2c985a28 fix windows build. 10 years ago
Shirou WAKAYAMA a4671fcc2a move subdirectories. refer to issue #24 10 years ago