Commit Graph

1886 Commits (ed7efd5d012651985b2f490b52a727b6331627c3)
 

Author SHA1 Message Date
Conor Branagan 198e65c801 Add ConnectionsMax function that limits connections per pid.
The goal is to improve performance of connection fetching connections across
all processes when some processes can have several hundred or thousands of file
descriptors. Right now when you have many thousands of fds the process spends
lots of time inside the syscalls from Readdir and Readlink.

The public API works as before with two new functions:

- `ConnectionsMax`
- `ConnectionsPidMax`

Each function takes an additional int argument that sets the max number of fds
read per process.
shirou 449c8250b0 Merge pull request #285 from sparrc/patch-1
Fix /proc/net/dev dropOut and fifoOut indices
Cameron Sparr d74d84e593 Fix /proc/net/dev dropOut and fifoOut indices
fixes #284
Shirou WAKAYAMA 061b699a97 Add OpenBSD to README (Thank you @mpfz0r)
shirou 136f6ca669 Merge pull request #283 from mpfz0r/master
Add support for OpenBSD/amd64
Marco Pfatschbacher b4846b445b Add support for OpenBSD/amd64
This code is based on the FreeBSD version
and implements roughly the same feature set.
shirou 110eb1f082 Merge pull request #280 from shirou/darwin-goslices
cpu[darwin]: fix Go arrays panic in cgo #279
Shirou WAKAYAMA ae251eb6a2 cpu[darwin]: fix Go arrays panic in cgo #279
Shirou WAKAYAMA a63900a44b update README about taging.
shirou 1516eb9ddc Merge pull request #275 from sparrc/sparrc-issue-245
Fix NetIOCounter windows interface behavior
Cameron Sparr 5af5f08785 Fix NetIOCounter windows interface behavior
addresses a few things:

- Windows has a concept of both a network "interface" and an "adapter"
- These are almost always a one-to-one relationship, though there can be
esoteric instances where they are not.
- I believe the gopsutil NetIOCounters function should only return on a
per-interface level, since this is the behavior on linux/darwin.

Previously, the plugin was basically ignoring the actual interfaces
returned from net.Interfaces(). Instead, it was looping over the net
adapters for each interface, somewhat uselessly.

FWIW, the code for getAdapterList() doesn't exist in the Go standard lib
anymore.

closes #245
shirou 6f43e5d707 Merge pull request #274 from leitao/master
Improve CPU identification for POWER processors
Breno Leitao 286927a039 Improve CPU identification for POWER processors
Currently gopsutils fails to indentify the POWER processors family,
returning an almost empty Info() structure.

This patch improves the POWER identification without changing what is
available for x86.
Nex 189b8e6d12 Fixed missing bin and unused stderr
Nex b6a7649aab Error handling
Nex 5c0ac28fed Changing a little the return values
Nex d9b355f75e Added proper piping of commands
Nex dd3cbcc611 Trying remove single quotes
Nex 1534b109ae Fixing pid name
Nex 8c3e7bd255 Casting pid properly
Nex 9659355f49 Checking content
Nex 8bb06aca3d Fixed type casting
Nex 5481d93989 Fixing assignment of vars
Nex 4f7834af25 Added attempt to get exe path from pid
shirou c2dd8ca3d4 Merge pull request #269 from andhe/ppc64le
Allow clock field in /proc/cpuinfo as cpu MHz fallback value
Andreas Henriksson 9d51bfe3bb Allow clock field in /proc/cpuinfo as cpu MHz fallback value
Needed on ppc64le debian porter boxes atleast.

See #230
Conor Branagan 5afd6f21c9 Cache the boot time after first query.
When fetching stats on all processes at once there's a non-trivial amount of
time spent in the `BootTime` call. But since this value should never change
during a live process, we can use a cached version for all subsequent calls.
shirou fc800d3fb4 Merge pull request #267 from botherder/master
Added Terminate() for Windows
shirou 2facc8e8ed Merge pull request #265 from hosting-de-labs/add-net-uid
add Uids field to net_linux
Nex d44bd00182 Added Terminate() for Windows
Jean Kahrs e004ef15e1 remove unused code
Jean Kahrs d6f5a9e920 fix net_test.go
Jean Kahrs 98a0a30dca update test
Jean Kahrs ab24c97439 break import cycle
Jean Kahrs cba0992ab3 add Uids field to net_linux
shirou 14eb7acb23 Merge pull request #264 from hillu/percent
cpu.Percent() on Windows is very slow.
Hilko Bengen 832dcb96c8 cpu.Percent (Windows): Use the same implementation as on Unix
WMI is way too slow.
shirou af2b5127ea Merge pull request #263 from digitalis-io/master
added weightedIO field to disk IOCountersStat (last field of /etc/mtab)
Marc Magnin 31f4fb8dee fixed test TestDiskIOCountersStat_String to consider new weightedIO field
Marc Magnin acf3fef036 added weightedIO field to disk IOCountersStat (last field of /etc/mtab)
shirou 5332238407 Merge pull request #261 from monstermunchkin/issues/260
process: make `ClockTicks` arch-independent
Thomas Hipp 68ad8d603c
process: make `ClockTicks` arch-independent
The value for `ClockTicks` is defined as `100` by the Linux kernel for
all currently supported architectures in Go. Therefore, there is no need
to define this constant for each architecture separately.

This fixes #260.

Signed-off-by: Thomas Hipp <thomashipp@gmail.com>
shirou c2c33439b4 Merge pull request #259 from monstermunchkin/issues/258
process: determine page sizes via function
Thomas Hipp eb4a57117f
process: determine page sizes via function
Instead of hard-coding the page size for linux systems, use Go's
`Getpagesize` function.

This resolves #258.

Signed-off-by: Thomas Hipp <thipp@suse.de>
shirou 214acac9ea Merge pull request #256 from shirou/change-platform-version-on-darwin
[host]darwin: change to use sw_vers to get platform version
Shirou WAKAYAMA 4bab832fc5 fix broken CurrentStatus table.
Shirou WAKAYAMA b9067179ef [host]darwin: change to use sw_vers to get platform version
shirou f20771d32a Merge pull request #255 from lberruti/fix_swap_mem_linux
Fix: wrong swap values on i686 / 4GB ram.
shirou ea490ab3c5 Merge pull request #254 from bclermont/fix-multidigit-interface
OSX Workaround: support interface with multiple digits
Bruno Clermont 3f96312057 only run ifconfig/netstat if necessary, add some tests