Commit Graph

680 Commits

Author SHA1 Message Date
Shirou WAKAYAMA adf2f03a48 fix build and path error 2016-04-01 22:28:07 +09:00
Shirou WAKAYAMA bce9212def fix build bugs. 2016-04-01 22:22:03 +09:00
Shirou WAKAYAMA d21ed2b40d search path via exec.LookPath before actual invoke. 2016-04-01 22:13:05 +09:00
Shirou WAKAYAMA 613a8a90e1 fixed by golint. 2016-04-01 21:34:39 +09:00
Shirou WAKAYAMA 944429d994 fixed by errcheck 2016-04-01 21:02:20 +09:00
Shirou WAKAYAMA da89408631 Merge branch 'master' into v2 2016-03-31 18:08:24 +09:00
WAKAYAMA shirou 37d8908841 [process]freebsd: implementes proceess.Nice() 2016-03-31 17:34:09 +09:00
WAKAYAMA shirou 37b6b4051f [process]freebsd: process_freebsd_amd64.go is now generated by cgo godefs. 2016-03-31 17:19:49 +09:00
WAKAYAMA shirou e5c53aa342 Merge branch 'master' of github.com:shirou/gopsutil 2016-03-31 15:41:59 +09:00
Shirou WAKAYAMA 15a7edb712 [process]linux: linux process status change to "R" not "Running" see #173 2016-03-27 21:54:02 +09:00
Shirou WAKAYAMA 4bb84648bf JSON representation is renamed to fit Google JSON style, camelCase. 2016-03-23 10:52:46 +09:00
Shirou WAKAYAMA 46ddd57c72 process has NetIOCounters and IOCounters. 2016-03-22 23:23:08 +09:00
Shirou WAKAYAMA ea152ea901 [BREAKING CHANGE] rename functions to pass golint. ex) net.NetIOCounters -> net.IOCounters 2016-03-22 23:09:12 +09:00
Shirou WAKAYAMA be06a94d44 fix the gopkgin versioning on README. 2016-03-22 21:55:16 +09:00
Shirou WAKAYAMA 70ba28090d add version 2 breaking change notification to README. 2016-03-22 21:51:43 +09:00
WAKAYAMA shirou dc8b14acd5 [disk]freebsd: change to use C.sizeof_struct. 2016-03-20 22:48:17 +09:00
Shirou WAKAYAMA 1f32ce1bb3 [net]linux: skip if "/proc/sys/net" is not exists on test environment. 2016-03-15 22:47:56 +09:00
Shirou WAKAYAMA fa3e1cc196 [common]linux: add HostEtc to switch '/etc' See #175. 2016-03-13 23:42:06 +09:00
shirou 4dfd293fa8 Merge pull request #169 from shirou/net/replace_lsof
[net]linux: start replacing lsof
2016-03-12 23:47:39 +09:00
Shirou WAKAYAMA 34b63e671b [net]linux: add a test and fix private field name. 2016-03-10 22:32:16 +09:00
Shirou WAKAYAMA 627d2a9871 [process]: fix CPU_Percent always 0 if duration > 0 (#172) 2016-03-09 10:09:27 +09:00
Shirou WAKAYAMA 567da004c5 [net]linux: explicit skip CI. 2016-03-06 00:02:06 +09:00
Shirou WAKAYAMA 32fa88eb49 [net]linux: TestGetProcInodes will fail on CI. 2016-03-05 23:57:18 +09:00
Shirou WAKAYAMA 31439aa6b5 [net]linux: fix valious bugs in NetConnections. 2016-03-05 23:53:32 +09:00
Shirou WAKAYAMA e4ddff09d5 [net]linux: add process_unix for NetConnections. 2016-03-05 22:24:26 +09:00
Shirou WAKAYAMA 32c62b5d48 [net]linux: implement processInet(). 2016-03-04 23:42:22 +09:00
Shirou WAKAYAMA 715c421b57 [process]: add OpenFiles() test. 2016-03-04 09:42:40 +09:00
shirou 24e2746d13 Merge pull request #171 from raviparimi/make-slice-errors
Provide correct length for slice creation.
2016-03-04 09:34:04 +09:00
raviparimi be2dab5a40 Provide correct length for slice creation.
- Creating a slice of length numFDs and later appending elements to it
  results in a slice whose first numFDs elements are all nil. It is
  sufficient to create a slice of zero length since we are appending
  elements to it.
- The current allocation will make ret a slice of length 0. What's
  needed is a slice of length len(ofs).
2016-03-03 15:10:23 -08:00
shirou a0cf924cac Merge pull request #170 from vecmezoni/fd-close
NewProcess does not close file descriptor
2016-03-03 09:48:12 +09:00
Alexander Inozemtsev f4902fae49 Properly close opened file 2016-03-02 18:19:52 +03:00
Shirou WAKAYAMA 6c352016d8 [net]linux: start replacing lsof. still work in progress. 2016-03-01 23:38:13 +09:00
Shirou WAKAYAMA 1de1357e77 [process]: add FailNow to avoid panic. 2016-02-29 21:59:02 +09:00
shirou 1ab11f7afd Merge pull request #167 from cgilling/cmdline_slice
process: add CmdlineSlice function for linux + freebsd
2016-02-29 21:57:08 +09:00
Chris Gilling 8c186ae593 process: add CmdlineSlice for darwin + windows
darwin will not perform correctly if there are spaces in the actual
arguments, in which case a single argument will be reported as
multple. Some CGO would be needed to get around this I think.

I couldn't find any good documentation on how windows handles
command line arguments with spaces inside the actual arguments, so
this implementation merely just splits on spaces.
2016-02-28 19:49:50 -08:00
shirou d6702c96bd Merge pull request #168 from cgilling/faster_linux_new_process
process: change linux NewProcess to only stat /proc/[pid]
2016-02-29 10:09:30 +09:00
Chris Gilling a3bbd9e3cd process: change linux NewProcess to only stat /proc/[pid]
Before it was doing a fillFromStatus() call which was much slower
and none of the information was needed, except by the Name() func
which now will call fillFromStatus() if p.name is not set.
2016-02-28 06:47:37 -08:00
Chris Gilling d098bf135f process: fix bug in CmdlineSlice where cmdline is empty
Sometimes (at least on linux) cmdline is empty, this was causing
a panic.
2016-02-27 18:29:24 -08:00
Chris Gilling b8c40ac83c process: add CmdlineSlice function for linux + freebsd
This allows for getting more exact information about each argument
especially if there are arguments that have spaces in them.

This was not implemented for darwin or for windows because they
both currently have not way of properly parsing the cmdline string.
Darwin parses the output of 'ps' which is already whitespace
segmented, and windows just has the cmdline string.
2016-02-27 18:01:49 -08:00
shirou 3618a777a8 Merge pull request #162 from shirou/load/add_misc
[load]all: add Misc in load to get miscellaneous host info from /proc…
2016-02-27 02:01:46 +09:00
shirou cfe7e5f1ca Merge pull request #163 from walles/walles/test_proc_cputimes
Add test for process.CPUTimes()
2016-02-24 17:23:41 +09:00
Johan Walles 3232d34b24 Add test for process.CPUTimes() 2016-02-24 04:25:41 +01:00
Shirou WAKAYAMA 97bcc355a6 [process]linux: change to use exec.LookPath to invoke lsof. 2016-02-23 15:13:24 +09:00
shirou 1d09f7a4e9 Merge pull request #160 from walles/walles/vmtest
Document + add tests for for mem.VirtualMemory()
2016-02-22 15:56:05 +09:00
Johan Walles dd875d4970 Fix memory stats on Darwin, non-CGO 2016-02-22 07:29:15 +01:00
Johan Walles d109284df3 Fix memory stats on Darwin, CGO 2016-02-22 07:28:55 +01:00
Johan Walles 27093ae2d2 mem_darwin_test.go: Compare `total` to `sysctl hw.memsize` 2016-02-22 07:28:55 +01:00
Johan Walles 0d5592714b Fix memory stats on LinuxFreeBSD 2016-02-22 07:28:44 +01:00
Johan Walles 66a07939f7 Fix memory stats on Linux 2016-02-21 20:56:11 +01:00
Johan Walles 4438159155 Document + add tests for for mem.VirtualMemory()
This change changes and documents the (previously undocumented) behavior of Used
to "RAM used by programs".

We also remove the undocumented and unused Shared field of that struct.

So with this change in place, the VirtualMemoryStruct contains:
* three human-consumable fields for Total, Used and Available memory
* one human-consumable UsedPercentage field
* a number of kernel specific fields
2016-02-21 20:56:11 +01:00