Commit Graph

26 Commits (e6d16e985ab90c542b0eb0d43677c18dec46c887)

Author SHA1 Message Date
uubulb 9e6efdb991 update disk & cpu & process 6 months ago
uubulb 701a74be41 feat(cpu, mem, sensors)(darwin): cgo-free implementations 6 months ago
shirou bc060cc227 add SPDX License, remove old build tag, and replace import 10 months ago
Antoine Toulme b712e59295 fix more linting reports 2 years ago
mmorel-35 1e6b445a8a gofumpt 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
Tom Barker 84a665b712 Add mem.SwapDevices() method. 4 years ago
Lomanic e3c878cc43 [mem][darwin] Remove calls to sysctl binary in mem/mem_darwin.go #639 6 years ago
shirou 145dca90f7 change to use CommandContext. 7 years ago
shirou 4c73494c78 Add WithContext functions. 7 years ago
Sean Chittenden 635b971c0e
Move from the `syscall` package to the `golang.org/x/sys/{unix,windows}` 8 years ago
WAKAYAMA Shirou 1123132e5a [mem]darwin: swap memory was Kbytes, since linux is bytes. 8 years ago
Johan Walles dd875d4970 Fix memory stats on Darwin, non-CGO 9 years ago
Johan Walles 44f817eb8d Split mem_darwin.go into CGO and non CGO variants 9 years ago
Johan Walles 00504a37e3 Remove unused import 9 years ago
Johan Walles a6cd6f803b Use Go's built in syscall.Getpagesize() 9 years ago
Johan Walles 13e00c76e4 Use OS calls rather than exec() to get memory statistics
Before this change we used to exec() various binaries to find out memory
information.

While this worked, it was awfully slow.

And if somebody would want to compute how many percent of available memory all
PIDs on the system uses, that would take almost ten seconds on my laptop with
the previous implementation.

This implementation fares a lot better, and is smaller.
9 years ago
Shirou WAKAYAMA 7288e9a5af common[all]: add internal 10 years ago
Cameron Sparr 4bba3025ca Use vm_stat command on darwin to get memory
This has the benefit of allowing us to also grab the cached memory so
that we can get an "available" measurement
10 years ago
Myungjun Kim c5b94d3e4c memory[darwin]: return value of "sysctl hw.memsize" is memory size in bytes. 10 years ago
Shirou WAKAYAMA a9e65ec556 mem[darwin]: fix VirtualMem stat multiply. 10 years ago
Nikolay Sivko 06282a319c [darwin] hw.memsize already in bytes 10 years ago
若山史郎 cea341c690 mem: add 0 check to darwin.swapmem. 10 years ago
Shirou WAKAYAMA 13cd195a7e change package name. 10 years ago
Shirou WAKAYAMA a4671fcc2a move subdirectories. refer to issue #24 10 years ago