1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-26 13:48:59 +08:00

152 Commits

Author SHA1 Message Date
Jonathan Matthew
27ffa28a0d add support for OpenBSD/riscv64 2024-02-11 16:20:56 +10:00
Ville Skyttä
11bc5b3970 Avoid some uses of regexps 2023-12-21 10:00:30 +02:00
Justin Yang
826037fe4b Fix build_test on amd64 NetBSD 2023-09-29 16:36:44 +08:00
Justin Yang
7ffb24dbe3
Merge branch 'shirou:master' into feature/netbsd-arm64-port 2023-09-23 16:02:34 +08:00
Justin Yang
def3572629 format the code 2023-09-17 01:43:13 +08:00
Justin Yang
6100e33de2 mem: code cleanup 2023-09-10 02:31:10 +08:00
Justin Yang
4e662561c2 mem: Add support for NetBSD 2023-09-02 22:57:30 +08:00
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
2023-08-31 15:06:23 -04:00
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
2023-08-08 13:53:23 +02:00
Antoine Toulme
b712e59295 fix more linting reports 2023-06-03 14:17:16 -07:00
Antoine Toulme
38b94668ea allow to pass context values to override environment variables 2023-06-02 01:31:05 -07:00
Josh Powers
d71f0022a1 fix(mem): Correct capitalization of linux writeback
fixes: #1471
2023-05-24 08:03:03 -06:00
Matthieu MOREL
1fb1e3e3e6 ci(lint): correct gci linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-04-04 18:07:22 +00:00
shirou
852f455217 fix lint 2023-02-12 09:24:52 +00:00
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>
2022-12-20 13:13:01 +08:00
Steve Zhang
ccb11cf45e reuse the context.Context instead of creating a new Context 2022-11-28 22:30:09 -07:00
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).
2022-11-21 21:28:36 -07:00
Stuart Caie
d962cf2d68 Use the page size that host_statistics() pages are measured in 2022-07-25 12:22:57 +00:00
xca1075
b3ab1561bc more aix nocgo implementations 2022-06-17 14:53:16 +02:00
shirou
23f85def9b [mem]: fix test 2022-06-07 12:48:50 +00:00
shirou
5722370c72
Merge pull request #1275 from quanweiZhou/add-meminfo-fields
[mem][linux] added additional meminfo fields
2022-06-07 21:00:08 +09:00
xca1075
d4f012c565 fix aix nocgo compile 2022-06-03 17:43:52 +02:00
xca1075
e24e72062b aix: split code, that uses perfstat, to _cgo and _nocgo files 2022-06-03 17:01:36 +02:00
Martin Reindl
1d89235f34 host: add support for OpenBSD/armv7 2022-04-15 21:11:36 +02:00
quanweiZhou
ddaf2d7623 [mem][linux] added additional meminfo fields
support HugePages_Rsvd, HugePages_Surp

Signed-off-by: quanweiZhou <quanweiZhou@linux.alibaba.com>
2022-03-19 15:19:10 +08:00
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.
2022-03-04 18:56:33 +02:00
Ville Skyttä
1e56c6f421 Spelling and grammar fixes 2022-01-30 22:48:09 +02:00
mmorel-35
1e6b445a8a gofumpt 2021-12-22 21:54:41 +00:00
mmorel-35
eb5f6203d8 gofmt 2021-12-22 21:46:33 +00:00
Matthieu MOREL
c8fd8c7b1f
enable unparam linter 2021-12-22 19:53:14 +01:00
Matthieu MOREL
b673968d5d
enable errorlint linter 2021-12-04 22:29:38 +01:00
shirou
d2e27c1712 fix dependabot v2 deletion. 2021-12-01 00:12:55 +00:00
shirou
0969c9436b delete v2 directory, move v3 to top #1078 2021-11-30 23:47:59 +00:00
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.
2021-11-15 10:26:08 +01:00
Ville Skyttä
09c3ba3896 [mem][solaris] simplify regular expressions 2021-10-22 18:28:52 +03:00
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.
2021-10-22 18:27:43 +03:00
Ville Skyttä
768c3b1888 [mem][solaris] don't hardcode path to prtconf in error message 2021-10-22 18:22:07 +03:00
shirou
7ae41c1f40 [v2][solaris][mem] fix invoke ctx. 2021-10-17 13:20:16 +00:00
shirou
3e7da36a46 [mem][solaris] fix wrong variable name. 2021-10-17 10:13:04 +00:00
WAKAYAMA shirou
46d6fcc192 [mem][bsd] fix missing arg 2021-10-09 22:49:58 +09:00
shirou
582bb14d8a
[linux][mem] remove unnecessary import 2021-09-29 22:55:44 +09:00
Punya Biswal
32b14a3723 Use invoke.CommandWithContext 2021-09-28 10:09:43 -04:00
Punya Biswal
5169bfe02d
Update mem/mem_bsd.go
Co-authored-by: shirou <shirou.faw@gmail.com>
2021-09-10 21:36:00 -04:00
Punya Biswal
7c1aa06a5e Respond to review comments
* use LookPath for better error messages
* support procfs in containers
2021-09-08 16:15:26 -04:00
Tom Barker
84a665b712 Add mem.SwapDevices() method. 2021-08-19 10:16:30 -04:00
Guillaume Ballet
992d17af94 add support for OpenBSD arm64 2021-03-23 15:29:27 +01:00
Lomanic
cd25417bd7 [mem][linux] Fix #1002 only try to parse /proc/meminfo numeric values on fields we're interested in 2020-11-29 18:03:50 +01:00
Lomanic
07887a9e9f [mem][linux] Add mocked test for VirtualMemory() and fix SReclaimable SUnreclaim retrieval 2020-11-29 17:54:17 +01:00
Lomanic
4cfc60d68b
Merge pull request #928 from Lomanic/skip-tests-when-not-implemented 2020-09-06 13:33:31 +02:00
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.
2020-09-01 02:02:21 +02:00