Commit Graph

261 Commits (master)

Author SHA1 Message Date
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
Sean Chittenden d2ca7e8d2c
Remove redundant build tag 9 years ago
Shirou WAKAYAMA 57f6aebc7e add Timeout to invoke command and use common.Invoke refs: #201 9 years ago
Aaron Zinman 4041e7d31e Fix compile errors for iOS/arm64
- Added conditional preprocessor guard on cpu_darwin_cgo.go

- Duplicated disk_darwin_amd64 for arm64 (after confirming
that sys/mount.h are the same between the two platforms, hence the
constants should be valid).
9 years ago
Shirou WAKAYAMA 5daf090513 [cpu]linux: vendorId in cpuinfo is sometimes vendor_id. 9 years ago
Shirou WAKAYAMA bce9212def fix build bugs. 9 years ago
Shirou WAKAYAMA d21ed2b40d search path via exec.LookPath before actual invoke. 9 years ago
Shirou WAKAYAMA 613a8a90e1 fixed by golint. 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
Shirou WAKAYAMA 7f22150707 CPU num is different on the CircleCI environemnt, so we skip it. 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 4d7275adf7 Rebrandoning back. 9 years ago
Ryan J. O'Neil 2434a327b9 Removing race condition in CPUPercent calculation. 9 years ago
Ryan J. O'Neil 1b9883dc76 Rebrandoning so we can patch this library and have it work in our Godeps. 9 years ago
Daniel Theophanes fa7f8ba4e8 cpu: CPUInfo returns one item per physical thread. Fix "Cores" to 1 on Linux.
Fixes #104
10 years ago
Daniel Theophanes bc6481f7e0 Merge branch 'master' of https://github.com/shirou/gopsutil into cpu_test 10 years ago
Shirou WAKAYAMA 7288e9a5af common[all]: add internal 10 years ago
Daniel Theophanes 726e7c6406 cpu: fix cpu test on small ARM device where CPU can be at 100%+rounding.
Fixes #99
10 years ago
Daniel Theophanes 0af895258e common: rename package common to internal/common. Add ENV helper funcs.
Package common wasn't used for public functions. Place it in an
internal directory to prevent other packages from using.

Remove the distributed references to "HOST_PROC" and "HOST_SYS"
consts and combine into a common function. This also helps so that
if a env var is defined with a trailing slash all will continue to
work as expected.

Fixes #100
10 years ago
Daniel Theophanes 69221741e8 cpu: allow override of /sys dir. Fix CPUInfo /proc + cpuinfo combine. 10 years ago
Daniel Theophanes ab2cba55ee Merge branch 'master' of https://github.com/shirou/gopsutil into cpu_arm 10 years ago
Daniel Theophanes 9f2e6a74cc cpu: support ARM CPUs.
ARM CPUs don't include the same fields as  x86 and amd64 CPUs in
the /proc/cpuinfo list. Pull information from the /sys/...
device tree as well as updating when a CPU is done in cpuinfo.

Fixes #88
10 years ago
Jonathan Chauncey 0461c50666 chore(*): Fixes #94
Added the ability to fetch an alternative location for /proc via an
environment variable. If the env var is not set it will return /proc as
the default value.
10 years ago
Shirou WAKAYAMA a95dde9672 cpu[darwin]: separetes cpu_darwin to cgo and nocgo to get CPUTimes. 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
Shirou WAKAYAMA 47f6760cf3 cpu[darwin]: use CGO to get CPUTimes. This is breaking. see #66. 10 years ago
shirou 3c958a8ee6 Merge pull request #60 from mayowa/master
Bug fix and HostStatInfo.Platform* windows implementation
10 years ago
mayowa 6fa0704dbf fixed: ProcessorId doesnt return a value 10 years ago
Shirou WAKAYAMA 0d7ff2eb40 cpu[darwin]: convert cpu frequency to Mhz. 10 years ago
Chris Bednarski d5fa4f880f Read Darwin CPU frequency from sysctl hw.cpufrequency 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
Shirou WAKAYAMA cbe10d6761 cpu[darwin]: move helper path to under the HOME dir. 10 years ago
Shirou WAKAYAMA c195d77ce3 cpu[darwin]: enable cpu helper only the environemnetal variable set. 10 years ago
Shirou WAKAYAMA 755d3a4119 cpu[darwin]: change default tick to 100. 10 years ago
Shirou WAKAYAMA 12843632ca cpu[darwin]: experimental implemtation to get CPU times on darwin. 10 years ago
Shirou WAKAYAMA 5854011870 cpu: Steal, Guest, and GuestNice are not divided by CPU_TICK. 10 years ago
WAKAYAMA shirou 4bc631921f cpu: fix command output trim problem. 10 years ago
Shirou WAKAYAMA 8c17a750c6 get CLOCK TICK by using getconf. 10 years ago
gwind a750762737 Fix interpretation error about /proc/stat 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 ec2b509dda cpu: skip percpu percent test if windows. Windows can only get one CPU info currently. 10 years ago
WAKAYAMA Shirou 4694ce0e4d cpu: use wmic to get CPUInfo on Windows 10 years ago
WAKAYAMA shirou b8dc51929a forget to change float32 to float64 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 18ab22b6fc cpu: should be divided by CPU_TICK 10 years ago
codeskyblue 3b43a3f496 change cpu_linux.go: on some android, runtime.NumCPU() will not return right number of cpu cores 10 years ago
Shirou WAKAYAMA 13cd195a7e change package name. 10 years ago
Shirou WAKAYAMA 16de570414 merge 039b9defab 10 years ago
WAKAYAMA Shirou 9f2c985a28 fix windows build. 10 years ago
WAKAYAMA shirou d11680c773 fix bugs on FreeBSD. 10 years ago
Shirou WAKAYAMA a4671fcc2a move subdirectories. refer to issue #24 10 years ago