1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-05-10 19:29:14 +08:00

894 Commits

Author SHA1 Message Date
shirou
bc9d8fac2b Merge pull request #290 from DataDog/conor/connections-perf
Fast duplication check in inodes processing.
2016-12-21 14:21:05 +09:00
shirou
a2257218e1 Merge pull request #289 from DataDog/conor/cache-boot-time
Cache the boot time after first query.
2016-12-21 14:15:45 +09:00
Conor Branagan
276c873f0d Fast duplication check in inodes processing.
Instead of encoding a JSON string of each connection (non-trivial at high
connection volumes) we can use the connTmp struct for map look-ups if we
eliminate the unused `uids` field.

Also switches to using the empty struct instead of bool for zero memory
overhead.
2016-12-20 12:38:54 -05:00
WAKAYAMA Shirou
42156fdf0d [net]linux: fix NetFilterCounters filename 2016-12-20 23:59:53 +09:00
shirou
09887d1cba Merge pull request #287 from hush-hush/master
Add Slab, Shared and PageTables metric for VirtualMemory under linux
2016-12-20 14:24:33 +09:00
Maxime Mouial
44e27c6972 Add Slab, Shared and PageTables metric for VirtualMemory under linux 2016-12-19 14:01:27 +01:00
shirou
c42889c313 Merge pull request #268 from DataDog/conor/connections-max
Add ConnectionsMax function that limits connections per pid.
2016-12-12 22:47:19 +09:00
Conor Branagan
df61ef6d5f Add stub functions for ConnectionsMax in other OS versions. 2016-12-11 13:06:56 -05:00
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.
2016-12-11 13:05:40 -05:00
shirou
449c8250b0 Merge pull request #285 from sparrc/patch-1
Fix /proc/net/dev dropOut and fifoOut indices
2016-12-02 22:28:38 +09:00
Cameron Sparr
d74d84e593 Fix /proc/net/dev dropOut and fifoOut indices
fixes #284
2016-12-01 21:25:38 +00:00
Shirou WAKAYAMA
061b699a97 Add OpenBSD to README (Thank you @mpfz0r) v2.16.11 2016-11-25 09:04:14 +09:00
shirou
136f6ca669 Merge pull request #283 from mpfz0r/master
Add support for OpenBSD/amd64
2016-11-25 07:58:43 +09:00
Marco Pfatschbacher
b4846b445b Add support for OpenBSD/amd64
This code is based on the FreeBSD version
and implements roughly the same feature set.
2016-11-24 22:30:29 +01:00
shirou
110eb1f082 Merge pull request #280 from shirou/darwin-goslices
cpu[darwin]: fix Go arrays panic in cgo #279
2016-11-17 11:43:14 +09:00
Shirou WAKAYAMA
ae251eb6a2 cpu[darwin]: fix Go arrays panic in cgo #279 2016-11-15 00:53:20 +09:00
Shirou WAKAYAMA
a63900a44b update README about taging. 2016-10-27 22:29:33 +09:00
shirou
1516eb9ddc Merge pull request #275 from sparrc/sparrc-issue-245
Fix NetIOCounter windows interface behavior
v2.16.10
2016-10-27 00:44:21 +09:00
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
2016-10-25 16:51:40 +01:00
shirou
6f43e5d707 Merge pull request #274 from leitao/master
Improve CPU identification for POWER processors
2016-10-25 10:39:00 +09:00
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.
2016-10-24 14:11:12 -04:00
Nex
189b8e6d12 Fixed missing bin and unused stderr 2016-10-21 13:22:09 +02:00
Nex
b6a7649aab Error handling 2016-10-21 13:20:58 +02:00
Nex
5c0ac28fed Changing a little the return values 2016-10-21 13:19:19 +02:00
Nex
d9b355f75e Added proper piping of commands 2016-10-21 13:16:22 +02:00
Nex
dd3cbcc611 Trying remove single quotes 2016-10-21 12:36:58 +02:00
Nex
1534b109ae Fixing pid name 2016-10-21 12:27:14 +02:00
Nex
8c3e7bd255 Casting pid properly 2016-10-21 12:26:00 +02:00
Nex
9659355f49 Checking content 2016-10-21 12:21:10 +02:00
Nex
8bb06aca3d Fixed type casting 2016-10-21 12:15:15 +02:00
Nex
5481d93989 Fixing assignment of vars 2016-10-21 12:10:41 +02:00
Nex
4f7834af25 Added attempt to get exe path from pid 2016-10-21 12:07:28 +02:00
shirou
c2dd8ca3d4 Merge pull request #269 from andhe/ppc64le
Allow clock field in /proc/cpuinfo as cpu MHz fallback value
2016-10-15 21:41:39 +09:00
Andreas Henriksson
9d51bfe3bb Allow clock field in /proc/cpuinfo as cpu MHz fallback value
Needed on ppc64le debian porter boxes atleast.

See #230
2016-10-14 14:05:32 +02:00
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.
2016-10-13 11:24:29 -04:00
shirou
fc800d3fb4 Merge pull request #267 from botherder/master
Added Terminate() for Windows
2016-10-12 00:28:17 +09:00
shirou
2facc8e8ed Merge pull request #265 from hosting-de-labs/add-net-uid
add Uids field to net_linux
2016-10-12 00:26:04 +09:00
Nex
d44bd00182 Added Terminate() for Windows 2016-10-11 15:19:00 +02:00
Jean Kahrs
e004ef15e1 remove unused code 2016-10-11 10:34:47 +02:00
Jean Kahrs
d6f5a9e920 fix net_test.go 2016-10-06 15:46:14 +02:00
Jean Kahrs
98a0a30dca update test 2016-10-06 15:38:56 +02:00
Jean Kahrs
ab24c97439 break import cycle 2016-10-06 15:32:25 +02:00
Jean Kahrs
cba0992ab3 add Uids field to net_linux 2016-10-06 14:50:03 +02:00
shirou
14eb7acb23 Merge pull request #264 from hillu/percent
cpu.Percent() on Windows is very slow.
2016-09-30 21:56:23 +09:00
Hilko Bengen
832dcb96c8 cpu.Percent (Windows): Use the same implementation as on Unix
WMI is way too slow.
2016-09-27 18:15:05 +02:00
shirou
af2b5127ea Merge pull request #263 from digitalis-io/master
added weightedIO field to disk IOCountersStat (last field of /etc/mtab)
2016-09-22 21:59:23 +09:00
Marc Magnin
31f4fb8dee fixed test TestDiskIOCountersStat_String to consider new weightedIO field 2016-09-22 00:03:48 +02:00
Marc Magnin
acf3fef036 added weightedIO field to disk IOCountersStat (last field of /etc/mtab) 2016-09-21 23:48:49 +02:00
shirou
5332238407 Merge pull request #261 from monstermunchkin/issues/260
process: make `ClockTicks` arch-independent
2016-09-19 22:31:52 +09:00
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>
2016-09-17 18:06:07 +02:00