Commit Graph

18 Commits (c7c548d6bdb46b39cd36ae0815926de70ab1b8ca)

Author SHA1 Message Date
Steve Zhang ccb11cf45e reuse the context.Context instead of creating a new Context
Steve Zhang cf62eac8f9 The current codes miss below statistic data under solaris/illumos:
1. the disk io statistic data as: nread, nwritten, reads, writes, rtime, wtime;
2. the free memory under global zone;
3. the net io statistic data as: rbytes64, ipackets64, idrops64, ierrors, obytes64, opackets64, odrops64, oerrors.

The new feature branch adds the above missing statistic data based on the psutil project (https://psutil.readthedocs.io/), it has been tested under solaris ( Oracle Solaris 11.4 X86) and illumos (OmniOS v11 r151044).
Ville Skyttä f7e1f36418 refactor: remove unnecessary exec.LookPath calls
Executing the command does the lookup if needed and returns the same
error when not found, no need to do it separately.
mmorel-35 1e6b445a8a gofumpt
shirou 0969c9436b delete v2 directory, move v3 to top #1078
Ville Skyttä 09c3ba3896 [mem][solaris] simplify regular expressions
Ville Skyttä 093e68cb91 [mem][solaris] improve prtconf memory size scraping
Accept uppercase Memory, that's how it appears to be at least in Solaris
11.3 and OpenIndiana oi_151a7.
Ville Skyttä 768c3b1888 [mem][solaris] don't hardcode path to prtconf in error message
shirou 7ae41c1f40 [v2][solaris][mem] fix invoke ctx.
shirou 3e7da36a46 [mem][solaris] fix wrong variable name.
Punya Biswal 32b14a3723 Use invoke.CommandWithContext
Punya Biswal 7c1aa06a5e Respond to review comments
* use LookPath for better error messages
* support procfs in containers
Tom Barker 84a665b712 Add mem.SwapDevices() method.
Segflow 86c7289ccc Fix: use filename in exec.LookPath instead of full path
exec.LookPath searches for the file in the $PATH, which mean giving it an absolute path is against it's own purposes.
shirou 145dca90f7 change to use CommandContext.
shirou 4c73494c78 Add WithContext functions.
WAKAYAMA Shirou f8ef680a47 error strings change to lowercase
James Nugent b7760bb5a6 memory: Add basic Solaris VirtualMemory() support
This commit adds support for VirtualMemory() in package mem. The support
only extends to total memory capcity, since that is all that is required
in Nomad. It does take into account global versus non-global zones, and
does not use cgo.

This has been tested inside a zone in the Joyent public cloud for a
non-global zone, and in the global zone of a SmartOS virtual machine.