Max Altgelt
7411b4e266
fix: use err from Syscall instead of calling GetLastError
...
Call() already returns the last error, see
https://pkg.go.dev/syscall?GOOS=windows#Proc.Call .
However, some code called GetLastError() afterwards, which is racy;
if the go routine switches threads between Call() and GetLastError(),
it may return a different error than expected, or possibly nil.
2 weeks ago
Matthieu MOREL
7166a61915
fix: address `//nolint:contextcheck`
...
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2 months ago
shirou
7b14b866f1
Merge pull request #1783 from mmorel-35/revive/unused-parameter
...
chore: enable unused-parameter from revive
2 months ago
shirou
9d29c70c52
Merge pull request #1813 from mmorel-35/gocritic
...
chore: enable gocritic linter
2 months ago
Matthieu MOREL
dfdd90ab72
chore: enable gocritic linter
2 months ago
Matthieu MOREL
dc9b409803
chore: enable unused-parameter from revive
...
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2 months ago
Matthieu MOREL
a5e496769c
chore: enable begin rule from thelper
...
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2 months ago
Matthieu MOREL
8c1a718a5d
chore: use testify instead of testing
...
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2 months ago
Matthieu MOREL
30aff030d0
chore(golangci-lint): GOOS and GOARCH matrix
...
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
3 months ago
Matthieu MOREL
9ce2ec161e
chore: enable golangci-lint on Windows and MacOS
...
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
4 months ago
Matthieu MOREL
06e4051c91
enable testifylint linter
...
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
6 months ago
shirou
aa47e0fde0
Merge pull request #1720 from n4nn31355/feat/win_mem_commit_total
...
feat(mem): Add windows commit stats
7 months ago
uubulb
3773f6fe43
fix(mem): possible memory leak on Windows
8 months ago
Vyacheslav Artemiev
3f241a0b08
feat(mem): Add windows commit stats
...
Closes Expose MemCommit info for Windows #1719
8 months ago
uubulb
9e6efdb991
update disk & cpu & process
8 months ago
uubulb
701a74be41
feat(cpu, mem, sensors)(darwin): cgo-free implementations
9 months ago
shirou
37f531010d
fix golangcilint errors, ignore gosec G115
9 months ago
shirou
5f158096be
fix: golangci lint with max -> maxConn
9 months ago
shirou
1221983189
[windows][mem]: change to use Performance Counter on SwapMemory.
10 months ago
shirou
3caf443966
[mem][windows]: add ExWindows and implement VirualTotal/Avail
...
This commit fixes #1588 . Thank you!
12 months ago
shirou
930a873984
[mem][linux]: add ExLinux on mem package and move VirtualMemoryEx info on it
12 months ago
shirou
e9591b5b01
rename redundant test function names, such as TestCPU in cpu package
12 months ago
shirou
bc060cc227
add SPDX License, remove old build tag, and replace import
12 months ago
Dylan Myers
a0bbccacc6
Only handle virtual memory when specifically requested
1 year ago
Jonathan Matthew
27ffa28a0d
add support for OpenBSD/riscv64
1 year ago
Ville Skyttä
11bc5b3970
Avoid some uses of regexps
1 year ago
Justin Yang
826037fe4b
Fix build_test on amd64 NetBSD
2 years ago
Justin Yang
7ffb24dbe3
Merge branch 'shirou:master' into feature/netbsd-arm64-port
2 years ago
Justin Yang
def3572629
format the code
2 years ago
Justin Yang
6100e33de2
mem: code cleanup
2 years ago
Justin Yang
4e662561c2
mem: Add support for NetBSD
2 years ago
Kevin Conaway
7f4efa5358
Add support for reading AnonHugePages from /proc/meminfo
...
This commit adds support for reading the `AnonHugePages` field from `/proc/meminfo`.
The values in this field allow monitoring the [THP](https://www.kernel.org/doc/Documentation/vm/transhuge.txt ) usage by systems that use this type of memory
2 years ago
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
3 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).
3 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