Commit Graph

144 Commits (8181a441a8db9872217c4d4fdfb176fa67b37310)

Author SHA1 Message Date
Hugo Beauzée-Luyssen 8181a441a8
mem: linux: fix vmstat field names
The field names are read from /proc/vmstat were capitalized as their
output fields by mistake
2 years ago
Antoine Toulme b712e59295 fix more linting reports 2 years ago
Antoine Toulme 38b94668ea allow to pass context values to override environment variables 2 years ago
Josh Powers d71f0022a1 fix(mem): Correct capitalization of linux writeback
fixes: #1471
2 years ago
Matthieu MOREL 1fb1e3e3e6 ci(lint): correct gci linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2 years ago
shirou 852f455217 fix lint 2 years ago
Eng Zer Jun 37894e9b28
test: use `T.Setenv` to set env vars in tests
This commit replaces `os.Setenv` with `t.Setenv` in tests. The
environment variable is automatically restored to its original value
when the test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.Setenv
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2 years ago
Steve Zhang ccb11cf45e reuse the context.Context instead of creating a new Context 2 years ago
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).
2 years ago
Stuart Caie d962cf2d68 Use the page size that host_statistics() pages are measured in 3 years ago
xca1075 b3ab1561bc more aix nocgo implementations 3 years ago
shirou 23f85def9b [mem]: fix test 3 years ago
shirou 5722370c72
Merge pull request #1275 from quanweiZhou/add-meminfo-fields
[mem][linux] added additional meminfo fields
3 years ago
xca1075 d4f012c565 fix aix nocgo compile 3 years ago
xca1075 e24e72062b aix: split code, that uses perfstat, to _cgo and _nocgo files 3 years ago
Martin Reindl 1d89235f34 host: add support for OpenBSD/armv7 3 years ago
quanweiZhou ddaf2d7623 [mem][linux] added additional meminfo fields
support HugePages_Rsvd, HugePages_Surp

Signed-off-by: quanweiZhou <quanweiZhou@linux.alibaba.com>
3 years ago
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.
3 years ago
Ville Skyttä 1e56c6f421 Spelling and grammar fixes 3 years ago
mmorel-35 1e6b445a8a gofumpt 3 years ago
mmorel-35 eb5f6203d8 gofmt 3 years ago
Matthieu MOREL c8fd8c7b1f
enable unparam linter 3 years ago
Matthieu MOREL b673968d5d
enable errorlint linter 3 years ago
shirou d2e27c1712 fix dependabot v2 deletion. 3 years ago
shirou 0969c9436b delete v2 directory, move v3 to top #1078 3 years ago
Tobias Klauser d935ecccea mem: use unix.SysctlUint64 for hw.memsize on darwin
Use unix.SysctlUint64 which directly returns an uint64 rather than
converting it from a string.
3 years ago
Ville Skyttä 09c3ba3896 [mem][solaris] simplify regular expressions 3 years ago
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.
3 years ago
Ville Skyttä 768c3b1888 [mem][solaris] don't hardcode path to prtconf in error message 3 years ago
shirou 7ae41c1f40 [v2][solaris][mem] fix invoke ctx. 3 years ago
shirou 3e7da36a46 [mem][solaris] fix wrong variable name. 3 years ago
WAKAYAMA shirou 46d6fcc192 [mem][bsd] fix missing arg 3 years ago
shirou 582bb14d8a
[linux][mem] remove unnecessary import 4 years ago
Punya Biswal 32b14a3723 Use invoke.CommandWithContext 4 years ago
Punya Biswal 5169bfe02d
Update mem/mem_bsd.go
Co-authored-by: shirou <shirou.faw@gmail.com>
4 years ago
Punya Biswal 7c1aa06a5e Respond to review comments
* use LookPath for better error messages
* support procfs in containers
4 years ago
Tom Barker 84a665b712 Add mem.SwapDevices() method. 4 years ago
Guillaume Ballet 992d17af94 add support for OpenBSD arm64 4 years ago
Lomanic cd25417bd7 [mem][linux] Fix #1002 only try to parse /proc/meminfo numeric values on fields we're interested in 4 years ago
Lomanic 07887a9e9f [mem][linux] Add mocked test for VirtualMemory() and fix SReclaimable SUnreclaim retrieval 4 years ago
Lomanic 4cfc60d68b
Merge pull request #928 from Lomanic/skip-tests-when-not-implemented 5 years ago
Lomanic 84afaae670 [host][mem][process][openbsd] Add 386 const and types definitions
Continuation of #721, this type using mktypes.sh that I didn't know at the time.
Weirdly, `go tool cgo -godefs` doesn't produce propery go-fmt-ed code, had to do run go-fmt manually afterwards.
5 years ago
Lomanic 7f588ac380
Merge pull request #930 from tklauser/openbsd-uvmpexp
Use unix.SysctlUvmexp on OpenBSD
5 years ago
Tobias Klauser 62354ea032 Fix TestVirtual_memory on OpenBSD
On OpenBSD, the total is used + free + cached + inactive like on macOS.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
5 years ago
Tobias Klauser aacbba22ae Use unix.SysctlUvmexp on OpenBSD
Use SysctlUvmexp from golang.org/x/sys/unix to avoid having to define
the type Uvmexp and the sysctl consts. This will also allow to build on
GOOS=openbsd with e.g. GOARCH=arm64.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
5 years ago
Lomanic ea86cbc3ff [mem] Skip tests on non-implemented platforms #446 5 years ago
Simon Thoby 3b64944534 Set the 'free' memory value to the 'available' memory on windows 5 years ago
James Bebbington 61cb122a84
Added comment noting that PgMajFault is Linux specific 5 years ago
James Bebbington 16fdb92bfc Add pgmajfault to data returned by vmstat on Linux 5 years ago
GameXG 144c67833a
fix #863 Swap.UsedPercent is inconsistent 5 years ago