Documentation ¶
Overview ¶
Package meminfo processes the memory information, /proc/meminfo. Instead of returning a Go struct, it returns JSON serialized bytes. A function to deserialize the JSON serialized bytes into a mem.Info struct is provided.
Note: the package name is meminfo and not the final element of the import path (flat).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deserialize ¶
Deserialize takes some JSON serialized bytes and unmarshals them as meminfo.Info.
func Get ¶
Get returns the current memory information as JSON serialized bytes using the package's global Profiler.
func NewTicker ¶
NewTicker returns a new Ticker containing a Data channel that delivers the data at intervals and an error channel that delivers any errors encountered. Stop the ticker to signal the ticker to stop running. Stopping the ticker does not close the Data channel; call Close to close both the ticker and the data channel.
Types ¶
type Profiler ¶
Profiler is used to get the memory information, as JSON, by processing the /proc/meminfo file.
func NewProfiler ¶
Returns an Initialized profiler that uses JSON; ready to use.