1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-05-10 19:29:14 +08:00

448 Commits

Author SHA1 Message Date
Cameron Sparr
6cd8284b30 When MemAvailable is in /proc/meminfo, use it (kernel 3.14+) 2015-09-21 17:18:20 -07:00
shirou
c1313e7634 Merge pull request #82 from influxdb/darwin-mem
Use vm_stat command on darwin to get memory
2015-09-18 16:31:13 +09:00
Cameron Sparr
4bba3025ca Use vm_stat command on darwin to get memory
This has the benefit of allowing us to also grab the cached memory so
that we can get an "available" measurement
2015-09-18 00:24:09 -07:00
WAKAYAMA shirou
be88485e9f mem[freebsd]: fix virtual memory available and used. 2015-09-18 14:01:49 +09:00
shirou
1daf67e7ad Merge pull request #81 from shirou/process/add_connections
process[linux, darwin]: implements Connections using lsof.
2015-09-18 13:41:46 +09:00
Shirou WAKAYAMA
b3cf7354f6 process[linux, darwin]: implements Connections using lsof. 2015-09-18 13:36:13 +09:00
shirou
a369a8857c Merge pull request #79 from influxdb/disk-linux-32bit
Support 32-bit linux, this field is int32 on 32-bit systems
2015-09-18 08:05:45 +09:00
Cameron Sparr
389d17e8a0 Support 32-bit linux, this field is int32 on 32-bit systems 2015-09-17 15:04:16 -07:00
Shirou WAKAYAMA
9c0474c2a7 update README 2015-09-16 17:20:43 +09:00
shirou
918bd3f404 Merge pull request #77 from shirou/add_process_parent_darwin_linux
Add process/Parent, net/NetConnections on darwin and linux
2015-09-16 16:38:18 +09:00
Shirou WAKAYAMA
4d0f737301 net: because lsof failed on drone.io, skip TestNetConnections if CI. 2015-09-16 16:33:07 +09:00
Shirou WAKAYAMA
0062ae2bfa use LookPath 2015-09-16 16:27:19 +09:00
Shirou WAKAYAMA
249a761b81 net[linux]: temporary enable error print. 2015-09-16 16:24:04 +09:00
Shirou WAKAYAMA
8d21be591e net[linux]: implements NetConnections() using lsof. 2015-09-16 16:20:07 +09:00
Shirou WAKAYAMA
c50db4f462 net[darwin]: implement NetConnections(). 2015-09-16 16:13:00 +09:00
Shirou WAKAYAMA
d6ac361a24 process[darwin,linux]: implements Parent using lsof. 2015-09-16 13:06:07 +09:00
Shirou WAKAYAMA
eb7739a6a5 process: forget to add guard. 2015-09-16 12:10:39 +09:00
Shirou WAKAYAMA
fc513b6f9a proces[darwin]: change exec.Command to interface to enable mocking.
Add common.invoker interface to mock exec.Command. common.FakeInvoker returns
expected file if exists instead of invoke exec.Command.
Currenly, mocking is enabled only process.Pids(). I will expand to other funcs incrementally.
2015-09-16 11:58:02 +09:00
shirou
026d4a3519 Merge pull request #75 from jinto/jinto
Detect error in CPUTimes fails on callPs, and modify comments on ReadLines
2015-09-13 21:05:06 +09:00
jay park
2984accfa1 return error when CPUTimes fails on callPs, modify comments on ReadLines 2015-09-13 13:05:09 +09:00
Shirou WAKAYAMA
a00c5af817 process[linux]: return up-to-date information when invoked. 2015-09-11 15:54:10 +09:00
shirou
e10ccf9971 Merge pull request #74 from choplin/patch-2
Ensure that process.MemoryInfo returns a up-to-date value.
2015-09-11 14:22:35 +09:00
choplin
cc3a104593 Ensure that process.MemoryInfo returns a up-to-date value. 2015-09-11 13:47:03 +09:00
Shirou WAKAYAMA
6bb6762470 net[darwin]: add drop count to NetIOCounter. 2015-09-11 12:18:33 +09:00
Shirou WAKAYAMA
e0b1d62a4d net[darwin]: add netstat -idbn example in the comment. 2015-09-11 11:24:03 +09:00
shirou
b1a9b3a5f3 Merge pull request #73 from influxdb/net-darwin-fix
Fix net stat reporting for Darwin
2015-09-11 11:22:27 +09:00
Cameron Sparr
c57e866f91 Fix net stat reporting for Darwin 2015-09-10 13:53:53 -06:00
WAKAYAMA Shirou
773d9d3caa disk[windows]: change to use WMI to get disk io counter information. 2015-09-05 22:53:18 +09:00
shirou
20ad984599 Merge pull request #70 from vrecan/win_disk
DiskPartitions Fails if cd not in drive And used and usedPercent are missing in windows
2015-09-05 21:45:53 +09:00
shirou
502be48c80 Merge pull request #71 from vrecan/patch-1
Fix cpu percent on windows
2015-09-05 21:37:56 +09:00
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.
2015-09-04 18:48:20 -06:00
Ben Aldrich
0fab61e73e remove log message 2015-09-04 13:41:08 -06:00
Ben Aldrich
6c000b035d don't fail if cd is not in a drive
add used and usedPercent back in
2015-09-04 11:51:34 -06:00
WAKAYAMA Shirou
5c8a03100e process[windows]: take common function to get Win32_Processes. 2015-09-03 22:07:24 +09:00
WAKAYAMA Shirou
cbd943016a process[windows]: implement CreateTime. 2015-09-03 21:59:24 +09:00
WAKAYAMA Shirou
4696985e84 cpu[windows]: skip if could not get cpu.LoadPercentage. 2015-09-03 21:48:18 +09:00
WAKAYAMA shirou
bb04b692c3 disk[freebsd]: update devstat mib. 2015-09-03 10:38:21 +09:00
WAKAYAMA shirou
6365c902e7 disk[freebsd]: fix typo. 2015-09-03 09:49:48 +09:00
shirou
af29b38440 Merge pull request #69 from vrecan/fix_build
Fix windows compile issues
2015-09-03 09:30:59 +09:00
Ben Aldrich
85a89e707b fix compile fail 2015-09-02 11:27:47 -06:00
Shirou WAKAYAMA
47f6760cf3 cpu[darwin]: use CGO to get CPUTimes. This is breaking. see #66. 2015-08-28 17:01:43 +09:00
shirou
3c958a8ee6 Merge pull request #60 from mayowa/master
Bug fix and HostStatInfo.Platform* windows implementation
2015-08-28 16:26:02 +09:00
mayowa
bf16d0a6a7 modified PlatformVersion and PlatformFamily string to (somewhat) match the output from sysinfo 2015-08-28 07:39:20 +01:00
mayowa
6fa0704dbf fixed: ProcessorId doesnt return a value 2015-08-28 06:56:05 +01:00
shirou
3a625ab13f Merge pull request #64 from influxdb/master
Fix memory reporting for linux systems
2015-08-28 07:45:56 +09:00
Cameron Sparr
1a037fddb1 Fix disk usage stats for windows 2015-08-27 09:51:03 -06:00
Cameron Sparr
ce70817f55 Fix memory reporting for linux systems
/proc/meminfo reports memory in KiloBytes and so needs a multiplier of
1024 instead of 1000.
The kernel reports in terms of pages and the proc filesystem is left
shifting by 2 for 4KB pages to get KB. Since this is a binary shift,
Bytes will need to shift by 10 and so get multiplied by 1024.

From the kernel code. PAGE_SHIFT = 12 for 4KB pages
"MemTotal:       %8lu kB\n", K(i.totalram)

Thanks to @subhachandrachandra!
2015-08-27 09:41:19 -06:00
Shirou WAKAYAMA
0d7ff2eb40 cpu[darwin]: convert cpu frequency to Mhz. 2015-08-27 15:50:35 +09:00
shirou
b1a93c4e33 Merge pull request #61 from cbednarski/f-darwin-cpu
Read Darwin CPU frequency from sysctl hw.cpufrequency
2015-08-27 15:47:26 +09:00
Chris Bednarski
d5fa4f880f Read Darwin CPU frequency from sysctl hw.cpufrequency 2015-08-26 11:45:09 -07:00