Commit Graph

620 Commits (v1)
 

Author SHA1 Message Date
shirou 79f021f66e Merge pull request #158 from walles/walles/darwin-memorypercent
process: Implement MemoryPercent() for Darwin
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
shirou 956f92742f Merge pull request #156 from shirou/add_build_check
Add build check
9 years ago
Shirou WAKAYAMA 01ddce7ff6 test verbose. 9 years ago
Shirou WAKAYAMA cb5866a546 we can not test other arch. 9 years ago
Shirou WAKAYAMA fb3a6df695 add other platform test 9 years ago
Shirou WAKAYAMA e21c97d3b2 [process]darwin: forget to change as binary.go movement. 9 years ago
WAKAYAMA shirou 0af91ba32b [disk,process]freebsd: binary.go moved to internal. 9 years ago
shirou 614df95d72 Merge pull request #155 from shirou/add_circleci
add circle.yml.
9 years ago
Shirou WAKAYAMA fe4c9f8ffa change CI status badge to CircleCI. 9 years ago
Shirou WAKAYAMA 5a09d40f6b [process]darwin: expected ps file was changed. 9 years ago
Shirou WAKAYAMA c822415e22 Merge branch 'master' into add_circleci 9 years ago
shirou 7fd975a4c0 Merge pull request #153 from walles/walles/processusername
Return correct user name from process.Username()
9 years ago
Shirou WAKAYAMA 7f22150707 CPU num is different on the CircleCI environemnt, so we skip it. 9 years ago
Shirou WAKAYAMA c54ae65e78 add circle.yml. 9 years ago
Johan Walles 17db0319c8 Empty commit to trigger CI 9 years ago
Johan Walles 09fbecef59 Darwin: Remove questionable UIDs
process.Process.uids is an array of undocumented values.

That one of them is the user that the process is running as is obvious, but what
the other two are supposed to be is AFAICT undocumented.

On Darwin, the second and third UID (out of three) seem to always be 0.

This change removes the two always-zero UIDs from the process.Process struct on
Darwin, and leaves just the one that actually identifies the user the process
is running as.
9 years ago
Johan Walles e3a7a45492 process.Username(): Correct user names on Darwin
Before this change, process.Username() returned "root" for all processes on
Darwin.
9 years ago
shirou 70b7a99f9b Merge pull request #152 from walles/walles/total-cpu-time
Make a public function for computing total CPU time
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
shirou b7e206ba77 Merge pull request #151 from vrecan/mem_info
fix meminfo output on consecutive calls
9 years ago
Ben Aldrich faeb99d327 fix meminfo output on consecutive calls 9 years ago
shirou e77438504d Merge pull request #144 from weberr13/noChildrenError
There are two possible error scenarios for CallPgrep.
9 years ago
Robert Weber c804a9e755 Per suggestions 9 years ago
shirou 59b63dedef Merge pull request #148 from cactus/sysctl-go
try to fix diskio stats on FreeBSD-10.x
9 years ago
elij d1380cba29 try to fix diskio stats on FreeBSD-10.x
FreeBSD apparently changed the magic sysctl mib values for devstats.

    --- FAIL: TestDisk_io_counters (0.00s)
    disk_test.go:39: error no such file or directory
    disk_test.go:42: ret is empty, map[]

This code uses an undocumented, but exported, go stdlib method to fetch
the sysctl by string instead of mib.
9 years ago
Robert Weber 4dcb099f3d no or 9 years ago
Robert Weber 6496b57b3d Need to promote this error 9 years ago
Robert Weber 21daedd6b4 There are two possible error scenarios for CallPgrep. One indicates a broken
system (no pgrep command) and one is a normal error state of pgrep
meaning no processes found for the criteria given (in this case the parent
pid does not exist or the process simply has no children).  The later case
is quite usefull to know about so I added a static error for this case.
9 years ago
shirou cc040ddf72 Merge pull request #139 from rburchell/master
host_linux: Skip everything that isn't a normal process.
9 years ago
Robin Burchell 55cacb4730 host_darwin: Use a named constant for USER_PROCESS.
Matches the host_linux change.
9 years ago
Robin Burchell 3fc7bc1ef7 host_linux: Skip everything that isn't a normal process.
host_darwin does the same filtering. Not doing this gives us some rather strange
entries that likely aren't what we want.

Before:
    {"user":"reboot","terminal":"~","host":"3.10.0-327.4.5.el7.x86_64","started":1454378260}
    {"user":"LOGIN","terminal":"ttyS0","host":"","started":1454378270}
    {"user":"LOGIN","terminal":"tty1","host":"","started":1454378270}
    {"user":"runlevel","terminal":"~","host":"3.10.0-327.4.5.el7.x86_64","started":1454378276}
    {"user":"root","terminal":"pts/0","host":"vpn","started":1454404513}

After:
    {"user":"root","terminal":"pts/0","host":"vpn","started":1454404513}
9 years ago
shirou 41f99949e3 Merge pull request #141 from ovear/master
fix callps command generate error
9 years ago
Heretic a0692cc17a 1)fix callps command generate error 9 years ago
shirou 9d8191d6a6 Merge pull request #137 from shirou/process/add_netiocounter_for_linux
[WIP] net,process[linux]: add process.NetIOCounter and net.NetIOCounterByFile.
9 years ago
shirou 61dd483154 Merge pull request #138 from sparrc/cs-ps-a
Add -a when calling ps on darwin
9 years ago
Cameron Sparr f251637a93 Add -a when calling ps on darwin 9 years ago
Shirou WAKAYAMA d680853370 net,process[linux]: add process.NetIOCounter and net.NetIOCounterByFile. 9 years ago
shirou 85bf0974ed Merge pull request #135 from influxdata/process-percent
Optimize per-process percentage calculation
9 years ago
Cameron Sparr 6688f35cd1 Optimize per-process stats calculation 9 years ago
shirou 8850f58d70 Merge pull request #134 from pquerna/pq/arch_add_release
Get Arch Linux Version from LSB
9 years ago
Paul Querna 008f2b4e18 Get Arch Linux Version from LSB 9 years ago
shirou b39e95359a Merge pull request #133 from sekimura/gofmt
format go program with go 1.5.2 "go fmt"
9 years ago
Masayoshi Sekimura 3a1fa5dc80 format go program with go 1.5.2 "go fmt" 9 years ago
shirou ef151b7ff7 Merge pull request #132 from shawnps/patch-1
fix typos
9 years ago
Shawn Smith 9cc9e82920 fix typos 9 years ago
shirou f58654fa1c Merge pull request #122 from jimmystewpot/add_netfilter
Add nf_conntrack counter support
9 years ago
shirou 134e15be26 Merge pull request #130 from sparrc/ibdnW
Add -W flag to netstat on BSD systems
9 years ago
shirou ff98b44420 Merge pull request #131 from yhat/cpu-race-condition-fix
CPU race condition fix
9 years ago
Ryan J. O'Neil 4d7275adf7 Rebrandoning back. 9 years ago