1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-26 13:48:59 +08:00

31 Commits

Author SHA1 Message Date
shirou
145dca90f7 change to use CommandContext. 2018-03-31 21:35:53 +09:00
Laurie Clark-Michalek
413cb32b6c Use static initialisation for invoke instances, instead of init funcs
The order of init function execution is dependant on the order that the
source files are passed to the compiler. This causes issues when
building under other build systems, such as bazel or buck, as they are
not guarenteed to maintain the same file order as the default go tool.
2018-03-21 14:08:39 +00:00
shirou
e776f6384a [docker]: fix typo. 2018-01-09 11:44:33 +09:00
shirou
a97abd3450
Merge branch 'master' into feature/add_context_support 2018-01-09 11:34:48 +09:00
shirou
1958326a49 [docker]: fix re-declartion 2018-01-09 11:21:13 +09:00
shirou
cd61c36c4f
Merge branch 'master' into feature/add_context_support 2018-01-09 11:18:25 +09:00
shirou
231815dfea [docker]: move String() to docker.go for all platforms. 2018-01-09 11:12:00 +09:00
shirou
4c73494c78 Add WithContext functions. 2017-12-31 15:25:49 +09:00
Shirou WAKAYAMA
57f6aebc7e add Timeout to invoke command and use common.Invoke refs: #201 2016-05-20 17:59:41 +09:00
Shirou WAKAYAMA
97e1d05084 [docker]linux: add CgroupDockerStat (#189) 2016-04-24 17:15:45 +09:00
Shirou WAKAYAMA
613a8a90e1 fixed by golint. 2016-04-01 21:34:39 +09:00
Shirou WAKAYAMA
4bb84648bf JSON representation is renamed to fit Google JSON style, camelCase. 2016-03-23 10:52:46 +09:00
Shirou WAKAYAMA
ea152ea901 [BREAKING CHANGE] rename functions to pass golint. ex) net.NetIOCounters -> net.IOCounters 2016-03-22 23:09:12 +09:00
Masayoshi Sekimura
3a1fa5dc80 format go program with go 1.5.2 "go fmt" 2016-01-09 16:17:21 -08:00
Shirou WAKAYAMA
40bbba9636 docker[linux]: add more memory stats in cgroup. 2015-11-21 23:00:37 +09:00
cgeoffroy
40f6755c6b docker: fix static /sys paths by using env variables 2015-11-12 13:53:18 +01:00
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
2015-10-18 20:40:01 -07:00
Ruslan Islamgaliev
005b9b7f7d Fix imports 2015-09-21 23:42:53 +03:00
Ruslan Islamgaliev
91bb4ddc07 Fix docker on Centos 7 2015-09-21 23:29:17 +03:00
WAKAYAMA shirou
abb4086531 host[freebsd]: change to use utmpx for 9.0 or later. 2015-08-15 01:20:56 +09:00
Shirou WAKAYAMA
1223e28905 docker[linux]: change docker error valiable and add cgroup error. 2015-08-07 10:16:06 +09:00
Cameron Sparr
7a2d225b30 Allow gopsutil docker to build on non-linux boxes by stubbing out non-linux libraries 2015-08-05 10:19:36 -06:00
Shirou WAKAYAMA
feb4fc9706 docker: fix field name. 2015-07-23 11:24:45 +09:00
Shirou WAKAYAMA
4ead971d70 fix CPUTimes type change problem on other packages. 2015-02-13 23:14:36 +09:00
Jason Wilder
90c6c3ef3e Fix panic in CgroupCPU
If an invalid container ID is passed to CgroupCPU,
a panic can result.
2015-02-10 11:36:19 -07:00
Jason Wilder
812b04d363 Don't ignore err when getting CgroupMemDocker stats
Fixes panic: runtime error: index out of range

goroutine 10 [running]:
testing.func·006()
	/usr/local/go/src/testing/testing.go:441 +0x181
github.com/shirou/gopsutil/docker.CgroupMem(0x586b30, 0x6, 0x5a87d0, 0x1c, 0x0, 0x0, 0x0)
	/home/jwilder/go/src/github.com/shirou/gopsutil/docker/docker_linux.go:119 +0xf48
github.com/shirou/gopsutil/docker.CgroupMemDocker(0x586b30, 0x6, 0x0, 0x0, 0x0)
	/home/jwilder/go/src/github.com/shirou/gopsutil/docker/docker_linux.go:184 +0x57

If the ID passed to the CGroupMemDocker does not exist, you can get
a panic at runtime.  This can happen when a container exits before
calling the func.
2015-02-10 11:32:40 -07:00
Shirou WAKAYAMA
13cd195a7e change package name. 2014-12-30 22:09:05 +09:00
Shirou WAKAYAMA
16de570414 merge 039b9defabe2fba35c9d3a4dbf7edc3fad812227 2014-12-27 23:42:00 +09:00
Shirou WAKAYAMA
a1c1d7b25f fix on Linux. 2014-11-27 10:32:35 +09:00
WAKAYAMA shirou
d11680c773 fix bugs on FreeBSD. 2014-11-27 10:25:14 +09:00
Shirou WAKAYAMA
a4671fcc2a move subdirectories. refer to issue #24 2014-11-27 10:18:15 +09:00