Commit Graph

14 Commits

Author SHA1 Message Date
shirou 4c73494c78 Add WithContext functions. 2017-12-31 15:25:49 +09:00
Sean Chittenden 635b971c0e
Move from the `syscall` package to the `golang.org/x/sys/{unix,windows}` 2017-06-02 13:51:00 -07:00
Maxime Mouial 4a1d5da977 Add 'SwapCached' to the VirtualMemoryStat informations on linux 2016-12-21 15:42:09 +01:00
Maxime Mouial 44e27c6972 Add Slab, Shared and PageTables metric for VirtualMemory under linux 2016-12-19 14:01:27 +01:00
Luca Berruti 36f47562c0 Fix: wrong swap values on i686 / 4GB ram.
According to sysinfo manpages: swap fields need to be interpreted along
with the mem_unit (Unit) field.

See also http://stackoverflow.com/a/4229727
2016-09-04 12:39:34 +02:00
kthommandra 1fd3a4dbad Added the writeback, dirty and writebacktmp fields from /proc/meminfo on Linux 2016-08-16 05:13:14 -07:00
Johan Walles 66a07939f7 Fix memory stats on Linux 2016-02-21 20:56:11 +01:00
Daniel Theophanes 0af895258e common: rename package common to internal/common. Add ENV helper funcs.
Package common wasn't used for public functions. Place it in an
internal directory to prevent other packages from using.

Remove the distributed references to "HOST_PROC" and "HOST_SYS"
consts and combine into a common function. This also helps so that
if a env var is defined with a trailing slash all will continue to
work as expected.

Fixes #100
2015-10-18 20:40:01 -07:00
Jonathan Chauncey 0461c50666 chore(*): Fixes #94
Added the ability to fetch an alternative location for /proc via an
environment variable. If the env var is not set it will return /proc as
the default value.
2015-10-17 11:34:41 -06:00
Cameron Sparr 6cd8284b30 When MemAvailable is in /proc/meminfo, use it (kernel 3.14+) 2015-09-21 17:18:20 -07:00
Cameron Sparr ce70817f55 Fix memory reporting for linux systems
/proc/meminfo reports memory in KiloBytes and so needs a multiplier of
1024 instead of 1000.
The kernel reports in terms of pages and the proc filesystem is left
shifting by 2 for 4KB pages to get KB. Since this is a binary shift,
Bytes will need to shift by 10 and so get multiplied by 1024.

From the kernel code. PAGE_SHIFT = 12 for 4KB pages
"MemTotal:       %8lu kB\n", K(i.totalram)

Thanks to @subhachandrachandra!
2015-08-27 09:41:19 -06:00
Shirou WAKAYAMA 13cd195a7e change package name. 2014-12-30 22:09:05 +09:00
WAKAYAMA shirou d11680c773 fix bugs on FreeBSD. 2014-11-27 10:25:14 +09:00
Shirou WAKAYAMA a4671fcc2a move subdirectories. refer to issue #24 2014-11-27 10:18:15 +09:00