fastStat

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2019 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Overview

Package fastStat - read current process stat from /proc/[pid]/stat used for CPU and memory usage monitoring

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProcStats

type ProcStats struct {
	Utime     float64 // Amount of time that this process has been scheduled in user mode
	Stime     float64 // Amount of time that this process has been scheduled in kernel mode
	Cutime    float64 // Amount of time that this process's waited-for chil‐dren have been scheduled in user mode
	Cstime    float64 // Amount of time that this process's waited-for chil‐dren have been scheduled in kernel mode
	Rss       int     // Resident Set Size: number of pages the process has in real memory
	Starttime float64 // The time the process started after system boot
	// contains filtered or unexported fields
}

ProcStats - Status information about the process /proc/[pid]/stat

type ProcStatsReader

type ProcStatsReader struct {
	Pid int
	// contains filtered or unexported fields
}

ProcStatsReader read info from /proc/[pid]/stat file

func (*ProcStatsReader) Close

func (p *ProcStatsReader) Close()

Close - close proc/[pid]/stat file

func (*ProcStatsReader) GetCPUAndMem

func (p *ProcStatsReader) GetCPUAndMem() (float64, int, error)

GetCPUAndMem - returns CPU and memory usage

func (*ProcStatsReader) Init

func (p *ProcStatsReader) Init() error

Init - initialize proc stat reader

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL