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.
2016-02-10 17:53:39 +01:00
shirou
b7e206ba77
Merge pull request #151 from vrecan/mem_info
...
fix meminfo output on consecutive calls
2016-02-10 11:28:44 +09:00
Ben Aldrich
faeb99d327
fix meminfo output on consecutive calls
2016-02-09 18:57:56 -07:00
shirou
e77438504d
Merge pull request #144 from weberr13/noChildrenError
...
There are two possible error scenarios for CallPgrep.
2016-02-09 10:57:08 +09:00
Robert Weber
c804a9e755
Per suggestions
2016-02-08 09:26:35 -07:00
shirou
59b63dedef
Merge pull request #148 from cactus/sysctl-go
...
try to fix diskio stats on FreeBSD-10.x
2016-02-07 22:54:03 +09:00
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.
2016-02-06 06:20:52 -08:00
Robert Weber
4dcb099f3d
no or
2016-02-04 15:15:29 -07:00
Robert Weber
6496b57b3d
Need to promote this error
2016-02-04 15:14:11 -07:00
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.
2016-02-04 15:06:36 -07:00
shirou
cc040ddf72
Merge pull request #139 from rburchell/master
...
host_linux: Skip everything that isn't a normal process.
2016-02-02 23:54:59 +09:00
Robin Burchell
55cacb4730
host_darwin: Use a named constant for USER_PROCESS.
...
Matches the host_linux change.
2016-02-02 15:23:34 +01:00
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}
2016-02-02 15:23:32 +01:00
shirou
41f99949e3
Merge pull request #141 from ovear/master
...
fix callps command generate error
2016-02-02 22:14:17 +09:00
Heretic
a0692cc17a
1)fix callps command generate error
2016-02-02 18:52:57 +08:00
shirou
9d8191d6a6
Merge pull request #137 from shirou/process/add_netiocounter_for_linux
...
[WIP] net,process[linux]: add process.NetIOCounter and net.NetIOCounterByFile.
2016-01-29 23:41:05 +09:00
shirou
61dd483154
Merge pull request #138 from sparrc/cs-ps-a
...
Add -a when calling ps on darwin
2016-01-27 10:47:22 +09:00
Cameron Sparr
f251637a93
Add -a when calling ps on darwin
2016-01-26 14:18:50 -07:00
Shirou WAKAYAMA
d680853370
net,process[linux]: add process.NetIOCounter and net.NetIOCounterByFile.
2016-01-21 17:31:05 +09:00
shirou
85bf0974ed
Merge pull request #135 from influxdata/process-percent
...
Optimize per-process percentage calculation
2016-01-20 15:20:56 +09:00
Cameron Sparr
6688f35cd1
Optimize per-process stats calculation
2016-01-19 21:36:45 -07:00
shirou
8850f58d70
Merge pull request #134 from pquerna/pq/arch_add_release
...
Get Arch Linux Version from LSB
2016-01-12 11:56:45 +09:00
Paul Querna
008f2b4e18
Get Arch Linux Version from LSB
2016-01-11 10:53:01 -08:00
shirou
b39e95359a
Merge pull request #133 from sekimura/gofmt
...
format go program with go 1.5.2 "go fmt"
2016-01-10 22:22:38 +09:00
Masayoshi Sekimura
3a1fa5dc80
format go program with go 1.5.2 "go fmt"
2016-01-09 16:17:21 -08:00
shirou
ef151b7ff7
Merge pull request #132 from shawnps/patch-1
...
fix typos
2015-12-31 23:20:55 +09:00
Shawn Smith
9cc9e82920
fix typos
2015-12-31 14:23:13 +09:00
shirou
f58654fa1c
Merge pull request #122 from jimmystewpot/add_netfilter
...
Add nf_conntrack counter support
2015-12-16 15:32:43 +09:00
shirou
134e15be26
Merge pull request #130 from sparrc/ibdnW
...
Add -W flag to netstat on BSD systems
2015-12-16 10:34:55 +09:00
shirou
ff98b44420
Merge pull request #131 from yhat/cpu-race-condition-fix
...
CPU race condition fix
2015-12-16 10:32:49 +09:00
Ryan J. O'Neil
4d7275adf7
Rebrandoning back.
2015-12-15 16:19:20 -05:00
Ryan J. O'Neil
2434a327b9
Removing race condition in CPUPercent calculation.
2015-12-15 15:22:30 -05:00
Ryan J. O'Neil
1b9883dc76
Rebrandoning so we can patch this library and have it work in our Godeps.
2015-12-15 14:51:35 -05:00
Cameron Sparr
432bcbd056
Add -W flag to netstat on BSD systems
...
This prevents netstat from truncating the interface name to 5
characters. See https://github.com/influxdb/telegraf/issues/438
2015-12-15 08:27:15 -07:00
shirou
de9cd47bb0
Merge pull request #127 from DataDog/fix-process-mem-unit-osx
...
process[darwin] Fix unit of RSS and VMS
2015-12-15 00:09:31 +09:00
shirou
dc452207f2
Merge pull request #128 from ontsysmattholcomb/use-env-proto-counters
...
using HostProc for protocounters in linux
2015-12-14 21:44:25 +09:00
Olivier Vielpeau
ec627e67ac
process[darwin] Fix unit of RSS and VMS
...
Should be bytes, `ps` returns Kbytes.
2015-12-14 12:13:27 +01:00
shirou
76c6e2ccc8
Merge pull request #125 from okmeter/fix_net_io_counters_freebsd
...
[net] fix panic on freebsd (netstat error with exit code 0)
2015-12-12 21:55:18 +09:00
shirou
123e227491
Merge pull request #126 from sparrc/godoc-badge
...
Add a godoc badge
2015-12-12 20:26:47 +09:00
Cameron Sparr
ec692ecfcf
Add a godoc badge
2015-12-11 12:46:15 -07:00
Nikolay Sivko
906df3ed85
[net] fix panic on freebsd (netstat error with exit code 0)
2015-12-11 14:47:48 +03:00
Matt Holcomb
21ccfe6b60
using HostProc for protocounters in linux
2015-12-10 16:37:36 +00:00
James Lamb
a9e946c7dd
change the snakecase to reflect the files being read
2015-12-09 07:49:20 +11:00
James Lamb
5700150054
Updated README.rst and included updated syntax to be more uniform with the other code
2015-12-09 07:45:26 +11:00
James Lamb
001ff20588
Merge branch 'master' into add_netfilter
2015-12-08 09:33:21 +11:00
James Lamb
22f35fd518
add netfilter counter support
2015-12-08 09:32:45 +11:00
shirou
fc932d9090
Merge pull request #121 from jimmidyson/stat-brackets-process-name
...
Handle process filenames with spaces in the name
2015-12-07 23:41:47 +09:00
Jimmi Dyson
7e4cef7a30
Handle process filenames with spaces in the name
...
Fixes #120
2015-12-07 09:27:07 +00:00
James Lamb
dfff8af4df
add nf_conntrack statistics to net_linux to query iptables/netfilter conntrack limits
2015-12-07 16:56:02 +11:00
Shirou WAKAYAMA
759e96ebaf
Merge branch 'master' of github.com:shirou/gopsutil
2015-12-01 23:30:02 +09:00