Commit Graph

620 Commits (v1)
 

Author SHA1 Message Date
WAKAYAMA shirou 37d8908841 [process]freebsd: implementes proceess.Nice() 9 years ago
WAKAYAMA shirou 37b6b4051f [process]freebsd: process_freebsd_amd64.go is now generated by cgo godefs. 9 years ago
WAKAYAMA shirou e5c53aa342 Merge branch 'master' of github.com:shirou/gopsutil 9 years ago
Shirou WAKAYAMA be06a94d44 fix the gopkgin versioning on README. 9 years ago
Shirou WAKAYAMA 70ba28090d add version 2 breaking change notification to README. 9 years ago
WAKAYAMA shirou dc8b14acd5 [disk]freebsd: change to use C.sizeof_struct. 9 years ago
Shirou WAKAYAMA 1f32ce1bb3 [net]linux: skip if "/proc/sys/net" is not exists on test environment. 9 years ago
Shirou WAKAYAMA fa3e1cc196 [common]linux: add HostEtc to switch '/etc' See #175. 9 years ago
shirou 4dfd293fa8 Merge pull request #169 from shirou/net/replace_lsof
[net]linux: start replacing lsof
9 years ago
Shirou WAKAYAMA 34b63e671b [net]linux: add a test and fix private field name. 9 years ago
Shirou WAKAYAMA 627d2a9871 [process]: fix CPU_Percent always 0 if duration > 0 (#172) 9 years ago
Shirou WAKAYAMA 567da004c5 [net]linux: explicit skip CI. 9 years ago
Shirou WAKAYAMA 32fa88eb49 [net]linux: TestGetProcInodes will fail on CI. 9 years ago
Shirou WAKAYAMA 31439aa6b5 [net]linux: fix valious bugs in NetConnections. 9 years ago
Shirou WAKAYAMA e4ddff09d5 [net]linux: add process_unix for NetConnections. 9 years ago
Shirou WAKAYAMA 32c62b5d48 [net]linux: implement processInet(). 9 years ago
Shirou WAKAYAMA 715c421b57 [process]: add OpenFiles() test. 9 years ago
shirou 24e2746d13 Merge pull request #171 from raviparimi/make-slice-errors
Provide correct length for slice creation.
9 years ago
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).
9 years ago
shirou a0cf924cac Merge pull request #170 from vecmezoni/fd-close
NewProcess does not close file descriptor
9 years ago
Alexander Inozemtsev f4902fae49 Properly close opened file 9 years ago
Shirou WAKAYAMA 6c352016d8 [net]linux: start replacing lsof. still work in progress. 9 years ago
Shirou WAKAYAMA 1de1357e77 [process]: add FailNow to avoid panic. 9 years ago
shirou 1ab11f7afd Merge pull request #167 from cgilling/cmdline_slice
process: add CmdlineSlice function for linux + freebsd
9 years ago
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.
9 years ago
shirou d6702c96bd Merge pull request #168 from cgilling/faster_linux_new_process
process: change linux NewProcess to only stat /proc/[pid]
9 years ago
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.
9 years ago
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.
9 years ago
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.
9 years ago
shirou 3618a777a8 Merge pull request #162 from shirou/load/add_misc
[load]all: add Misc in load to get miscellaneous host info from /proc…
9 years ago
shirou cfe7e5f1ca Merge pull request #163 from walles/walles/test_proc_cputimes
Add test for process.CPUTimes()
9 years ago
Johan Walles 3232d34b24 Add test for process.CPUTimes() 9 years ago
Shirou WAKAYAMA 97bcc355a6 [process]linux: change to use exec.LookPath to invoke lsof. 9 years ago
shirou 1d09f7a4e9 Merge pull request #160 from walles/walles/vmtest
Document + add tests for for mem.VirtualMemory()
9 years ago
Johan Walles dd875d4970 Fix memory stats on Darwin, non-CGO 9 years ago
Johan Walles d109284df3 Fix memory stats on Darwin, CGO 9 years ago
Johan Walles 27093ae2d2 mem_darwin_test.go: Compare `total` to `sysctl hw.memsize` 9 years ago
Johan Walles 0d5592714b Fix memory stats on LinuxFreeBSD 9 years ago
Johan Walles 66a07939f7 Fix memory stats on Linux 9 years ago
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
9 years ago
shirou e04a02d2d7 Merge pull request #161 from walles/walles/darwin-vmperf
Use OS calls rather than exec() to get memory stats on Darwin
9 years ago
Johan Walles 44f817eb8d Split mem_darwin.go into CGO and non CGO variants 9 years ago
Shirou WAKAYAMA 821a0141b1 [load]: add comments. 9 years ago
Shirou WAKAYAMA c973fdbc46 [load]linux: fix compile problems. 9 years ago
Shirou WAKAYAMA f9effa497e [load]all: add Misc in load to get miscellaneous host info from /proc/stat 9 years ago
Johan Walles 00504a37e3 Remove unused import 9 years ago
Johan Walles a6cd6f803b Use Go's built in syscall.Getpagesize() 9 years ago
Johan Walles 13e00c76e4 Use OS calls rather than exec() to get memory statistics
Before this change we used to exec() various binaries to find out memory
information.

While this worked, it was awfully slow.

And if somebody would want to compute how many percent of available memory all
PIDs on the system uses, that would take almost ten seconds on my laptop with
the previous implementation.

This implementation fares a lot better, and is smaller.
9 years ago
Johan Walles 5771ea9465 Add Darwin specific mem.VirtualMemory() tests 9 years ago
Shirou WAKAYAMA 3166d41538 set LC_ALL to C in order to avoid number formatting problem. 9 years ago