Commit Graph

15 Commits (3b18639664aab0e1c8b2406b5ae7332ad1bc9ee8)

Author SHA1 Message Date
Vyacheslav Kuznetsov a35c32b028 Commented the constants origin. 8 years ago
Vyacheslav Kuznetsov 4de4e17f06 Added limit constants. Implemented function to parse process limits from /proc. 8 years ago
Shannon Wynter c903f14189 Remove the requirement to use lsof by using the information provided in status to get the parent pid 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 627d2a9871 [process]: fix CPU_Percent always 0 if duration > 0 (#172) 9 years ago
Johan Walles 70444b571b process: Implement platform independent MemoryPercent()
It calls mem.VirtualMemory() and process.MemoryInfo(), so on the platforms where
those work MemoryPercent() will as well.

Tested on Darwin.
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
Cameron Sparr 6688f35cd1 Optimize per-process stats calculation 9 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
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.
10 years ago
Shirou WAKAYAMA 8db78af11e process: CPUPercent delta should be changed by CPUNums. 10 years ago
Shirou WAKAYAMA 2093d43c2a process: implement cpu_percent on linux. 10 years ago
Shirou WAKAYAMA 13cd195a7e change package name. 10 years ago
Shirou WAKAYAMA a4671fcc2a move subdirectories. refer to issue #24 10 years ago