proc

package
v0.0.0-...-dbddef4 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2017 License: GPL-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

View Source
const KERNEL26_DISKSTATS_INDEX = 2
View Source
const PROC_AVG = "/proc/loadavg"
View Source
const PROC_CPUINFO = "/proc/cpuinfo"
View Source
const PROC_DIR = "/proc"
View Source
const PROC_DISKSTATS = "/proc/diskstats"
View Source
const PROC_MEMNFO = "/proc/meminfo"
View Source
const PROC_NET_DATA = "/proc/net/dev"
View Source
const PROC_PARTITIONS = "/proc/partitions"
View Source
const PROC_STAT = "/proc/stat"
View Source
const PROC_SYS_KERNEL_HOSTNAME = "/proc/sys/kernel/hostname"
View Source
const PROC_SYS_KERNEL_OS = "/proc/sys/kernel/osrelease"
View Source
const PROC_UPTIME = "/proc/uptime"
View Source
const ProcMount = "/proc/mounts"

ProcMount where to find the information in os

Variables

View Source
var ValidFSList = []string{"ext2", "ext3", "ext4", "btrfs", "xfs", "gfs", "ntfs", "vfat"}

ValidFSList List of valid fs format to export

Functions

func CheckVersion

func CheckVersion(version int64) bool

Types

type AllFs

type AllFs struct {
	List map[string]FsInfo
}

AllFs struct to contain all fs fnformation

func (*AllFs) Init

func (fs *AllFs) Init()

Init prepare list of Fs

func (*AllFs) Update

func (fs *AllFs) Update()

Update refresh list of Fs

type Auth

type Auth struct {
	Name string
	Id   int
}

type DiskStat

type DiskStat struct {
	Name string
	Stat IoStat
	Diff IoStat
}

type DiskStats

type DiskStats struct {
	List      map[string]DiskStat
	Total     IoStat
	TotalDiff IoStat
}

DiskStats Information on disk stats (read, write, ...)

func (*DiskStats) Init

func (ds *DiskStats) Init()

Init prepare list of stats

func (*DiskStats) Update

func (ds *DiskStats) Update()

Update refresh list of stats

type FsInfo

type FsInfo struct {
	Dev   string
	Mount string
	Type  string
	Size  FsSize
}

FsInfo Information on Fs

type FsSize

type FsSize struct {
	BlockSize uint64
	Avail     uint64
	Used      uint64
	Total     uint64
}

FsSize Information on space of Fs

type IoStat

type IoStat struct {
	ReadsCompleted  int64
	ReadsMerged     int64
	SectorsRead     int64
	SpentReading    int64
	WritesCompleted int64
	WritesMerged    int64
	SectorsWritten  int64
	SpentWriting    int64
	IoInProgress    int64
	SpentIo         int64
	WeightedSpentIo int64
}

type Kernel

type Kernel struct {
	Hostname string
}

func (*Kernel) Init

func (k *Kernel) Init()

func (*Kernel) Update

func (k *Kernel) Update()

type Match

type Match struct {
	Name string
	// contains filtered or unexported fields
}

type Mem

type Mem struct {
	Info map[string]int64
}

func (*Mem) Init

func (m *Mem) Init()

func (*Mem) Update

func (m *Mem) Update()

type Misc

type Misc struct {
	Avg    string
	Uptime int64
}

func (*Misc) Init

func (m *Misc) Init()

func (*Misc) Update

func (m *Misc) Update()

type Net

type Net struct {
	List map[string]NetDev
}

Net struct to contain all network fnformation

func (*Net) Init

func (n *Net) Init()

Init prepare list of network

func (*Net) Update

func (n *Net) Update()

Update refresh list of network

type NetData

type NetData struct {
	Bytes      int64
	Packets    int64
	Errs       int64
	Drop       int64
	Fifo       int64
	Frame      int64
	Compressed int64
	Multicast  int64
}

type NetDev

type NetDev struct {
	Name         string
	Receive      NetData
	ReceiveDiff  NetData
	Transmit     NetData
	TransmitDiff NetData
}

type Proc

type Proc struct {
	Match
	Stat ProcStat
	Diff ProcStat
	Load ProcLoad
	// contains filtered or unexported fields
}

type ProcAll

type ProcAll struct {
	TimeStamp string
	HostId    string

	Stat       Stat
	Misc       Misc
	Memory     Mem
	Kernel     Kernel
	Processes  Processes
	FileSystem AllFs `json:"Fs,omitempty"`
	Network    Net
	DiskStats  DiskStats
	// contains filtered or unexported fields
}

func (*ProcAll) Init

func (pa *ProcAll) Init()

func (*ProcAll) Update

func (pa *ProcAll) Update()

type ProcCommon

type ProcCommon interface {
	Init()
	Update()
}

type ProcLoad

type ProcLoad struct {
	User   float32
	Nice   float32
	System float32
	Idle   float32
	All    float32
	Div    float32
}

type ProcMatch

type ProcMatch interface {
	// contains filtered or unexported methods
}

type ProcStat

type ProcStat struct {
	User   int64
	Nice   int64
	System int64
	Idle   int64
}

type Process

type Process struct {
	Pid       int64
	ParentPid int64
	Comm      string
	State     string
	Cmdline   string
	Stat      map[string]int64
	Statm     map[string]int64
	Diff      map[string]int64
	User      User
	Group     User

	ProcLoad  float32
	MemLoad   float32
	StartTime int64
	Hostname  string
	HostId    string
	TimeStamp string
	// contains filtered or unexported fields
}

func (*Process) Init

func (pr *Process) Init()

func (*Process) Update

func (pr *Process) Update()

type Processes

type Processes struct {
	/*
		all      map[int64]*Process
		All      []*Process
	*/
	List     map[string]*Process
	Time     int64
	TimePrev int64
}

Processes struct to contain all processes fnformation

func (*Processes) Init

func (pra *Processes) Init()

Init prepare list of processes

func (*Processes) Update

func (pra *Processes) Update()

Update refresh list of processes

type Stat

type Stat struct {
	Cpu        *Proc
	Cpus       []*Proc
	Stats      map[string]int64
	Sc_clk_tck C.long
	Pagesize   int
}

func (*Stat) Init

func (s *Stat) Init()

func (*Stat) Update

func (s *Stat) Update()

type User

type User struct {
	Real      Auth
	Effective Auth
}

Jump to

Keyboard shortcuts

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