Commit Graph

30 Commits

Author SHA1 Message Date
Antoine Toulme 5b9212e240 move the Env key out of internal packages 2023-06-02 01:31:05 -07: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
Jonathan Chauncey 0461c50666 chore(*): Fixes #94
Added the ability to fetch an alternative location for /proc via an
environment variable. If the env var is not set it will return /proc as
the default value.
2015-10-17 11:34:41 -06:00
Shirou WAKAYAMA 6e3f81ce18 net[linux]: fix lsof output 2015-10-11 22:15:47 +09:00
Shirou WAKAYAMA 5ae4dcc8ba net[linux]: fix lsof output in linux when no pid outputed. 2015-10-11 22:07:18 +09:00
Shirou WAKAYAMA 93e226a5e3 net[freebsd,linux,darwin]: merge unix like OSes. 2015-10-11 21:57:53 +09:00
Shirou WAKAYAMA 34195b4b58 net[darwin, linux]: get UDP information when inet or all specified. 2015-10-11 21:48:48 +09:00
Shirou WAKAYAMA b3cf7354f6 process[linux, darwin]: implements Connections using lsof. 2015-09-18 13:36:13 +09:00
Shirou WAKAYAMA 0062ae2bfa use LookPath 2015-09-16 16:27:19 +09:00
Shirou WAKAYAMA 8d21be591e net[linux]: implements NetConnections() using lsof. 2015-09-16 16:20:07 +09:00
Shirou WAKAYAMA c50db4f462 net[darwin]: implement NetConnections(). 2015-09-16 16:13:00 +09:00
Shirou WAKAYAMA fc513b6f9a proces[darwin]: change exec.Command to interface to enable mocking.
Add common.invoker interface to mock exec.Command. common.FakeInvoker returns
expected file if exists instead of invoke exec.Command.
Currenly, mocking is enabled only process.Pids(). I will expand to other funcs incrementally.
2015-09-16 11:58:02 +09:00
jay park 2984accfa1 return error when CPUTimes fails on callPs, modify comments on ReadLines 2015-09-13 13:05:09 +09:00
Shirou WAKAYAMA b5ffc220a6 common: Rename StringContains to StringsContains and add StringsHas. 2015-07-21 15:25:04 +09:00
WAKAYAMA shirou 64357f04e7 use StackExchange/wmi instead of invoking wmic process.
Note: This may not work on some old Windows XP.
2015-04-20 00:05:31 +09:00
WAKAYAMA Shirou 5f8b99aa65 windows: GetWmic returns [][]string where string split by "," 2015-03-20 22:48:58 +09:00
若山史郎 d1b9134c32 process: use syscall in common on darwin 2015-03-01 22:29:37 +09:00
WAKAYAMA shirou be5b5a5754 move CallSysCall to common/common_freebsd 2015-02-21 22:43:58 +09:00
WAKAYAMA Shirou bb1747fc85 disk: implements DiskIoCounterInfo on windows. Note: only read/write counts during 500 msec.
Thanks for mackerel-agent!
2015-02-19 23:52:06 +09:00
WAKAYAMA Shirou 4694ce0e4d cpu: use wmic to get CPUInfo on Windows 2015-02-15 21:25:33 +09:00
WAKAYAMA Shirou 69ad6a7822 fix new line problem on Windows 2015-02-12 22:34:00 +09:00
Shirou WAKAYAMA 59fefdbf72 add common_test. 2015-01-22 15:17:02 +09:00
Shirou WAKAYAMA 389b362cce if not NULL terminated, size is not set correctly. 2015-01-22 15:16:09 +09:00
Shirou WAKAYAMA 406cbe9b87 implements pernic of NetIOCounters. 2015-01-01 21:29:25 +09:00
Shirou WAKAYAMA 13cd195a7e change package name. 2014-12-30 22:09:05 +09:00
Shirou WAKAYAMA 3f7769ccfa implement disk_partition of Darwin using golang.org/x/sys/unix. 2014-12-28 22:30:07 +09:00
WAKAYAMA Shirou 9f2c985a28 fix windows build. 2014-11-27 22:28:05 +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