Commit Graph

34 Commits (7bebd975ecf14b9945485872fe34a9ebf98e7ac0)

Author SHA1 Message Date
Antoine Toulme 811185d3fe [common] add HOST_PROC_MOUNTINFO to EnvMap
shirou bc060cc227 add SPDX License, remove old build tag, and replace import
Antoine Toulme 35657e3262 add more env keys
Antoine Toulme 0cbdf257ab change to use a typed map per code review
Antoine Toulme 5b9212e240 move the Env key out of internal packages
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
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.
Shirou WAKAYAMA 6e3f81ce18 net[linux]: fix lsof output
Shirou WAKAYAMA 5ae4dcc8ba net[linux]: fix lsof output in linux when no pid outputed.
Shirou WAKAYAMA 93e226a5e3 net[freebsd,linux,darwin]: merge unix like OSes.
Shirou WAKAYAMA 34195b4b58 net[darwin, linux]: get UDP information when inet or all specified.
Shirou WAKAYAMA b3cf7354f6 process[linux, darwin]: implements Connections using lsof.
Shirou WAKAYAMA 0062ae2bfa use LookPath
Shirou WAKAYAMA 8d21be591e net[linux]: implements NetConnections() using lsof.
Shirou WAKAYAMA c50db4f462 net[darwin]: implement NetConnections().
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.
jay park 2984accfa1 return error when CPUTimes fails on callPs, modify comments on ReadLines
Shirou WAKAYAMA b5ffc220a6 common: Rename StringContains to StringsContains and add StringsHas.
WAKAYAMA shirou 64357f04e7 use StackExchange/wmi instead of invoking wmic process.
Note: This may not work on some old Windows XP.
WAKAYAMA Shirou 5f8b99aa65 windows: GetWmic returns [][]string where string split by ","
若山史郎 d1b9134c32 process: use syscall in common on darwin
WAKAYAMA shirou be5b5a5754 move CallSysCall to common/common_freebsd
WAKAYAMA Shirou bb1747fc85 disk: implements DiskIoCounterInfo on windows. Note: only read/write counts during 500 msec.
Thanks for mackerel-agent!
WAKAYAMA Shirou 4694ce0e4d cpu: use wmic to get CPUInfo on Windows
WAKAYAMA Shirou 69ad6a7822 fix new line problem on Windows
Shirou WAKAYAMA 59fefdbf72 add common_test.
Shirou WAKAYAMA 389b362cce if not NULL terminated, size is not set correctly.
Shirou WAKAYAMA 406cbe9b87 implements pernic of NetIOCounters.
Shirou WAKAYAMA 13cd195a7e change package name.
Shirou WAKAYAMA 3f7769ccfa implement disk_partition of Darwin using golang.org/x/sys/unix.
WAKAYAMA Shirou 9f2c985a28 fix windows build.
Shirou WAKAYAMA a1c1d7b25f fix on Linux.
WAKAYAMA shirou d11680c773 fix bugs on FreeBSD.
Shirou WAKAYAMA a4671fcc2a move subdirectories. refer to issue #24