collector

package
v0.0.0-...-a05615b Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2014 License: Apache-2.0 Imports: 15 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FSTYPE_IGNORE = map[string]bool{
	"cgroup":     true,
	"debugfs":    true,
	"devtmpfs":   true,
	"rpc_pipefs": true,
	"rootfs":     true,
}
View Source
var Multi uint64 = 1024

Functions

func CpuNum

func CpuNum() int

func Ext

func Ext(ext string) (ret map[string]uint64, err error)

@param ext e.g. TcpExt or IpExt

func KernelAllocateFiles

func KernelAllocateFiles() (ret uint64, err error)

func KernelHostname

func KernelHostname() (string, error)

func KernelMaxFiles

func KernelMaxFiles() (uint64, error)

func KernelMaxProc

func KernelMaxProc() (uint64, error)

func ListMountPoint

func ListMountPoint() ([][3]string, error)

func ListenPorts

func ListenPorts() []int64

func MHz

func MHz() (mhz string, err error)

func ReadProcStatus

func ReadProcStatus(path string) (name_state [2]string, err error)

func SocketStatSummary

func SocketStatSummary() (m map[string]uint64)

func SystemDate

func SystemDate() (string, error)

func SystemUptime

func SystemUptime() (arr [3]int64, err error)

Types

type CpuSnapshoot

type CpuSnapshoot struct {
	User     uint64 // time spent in user mode
	Nice     uint64 // time spent in user mode with low priority (nice)
	System   uint64 // time spent in system mode
	Idle     uint64 // time spent in the idle task
	Iowait   uint64 // time spent waiting for I/O to complete (since Linux 2.5.41)
	Irq      uint64 // time spent servicing  interrupts  (since  2.6.0-test4)
	SoftIrq  uint64 // time spent servicing softirqs (since 2.6.0-test4)
	Steal    uint64 // time spent in other OSes when running in a virtualized environment
	Guest    uint64 // time spent running a virtual CPU for guest operating systems under the control of the Linux kernel.
	Total    uint64 // total of all time fields
	Switches uint64 // context switches
}

func CpuSnapShoot

func CpuSnapShoot() (*CpuSnapshoot, error)

type DeviceUsageStruct

type DeviceUsageStruct struct {
	FsSpec            string
	FsFile            string
	FsVfstype         string
	BlocksAll         uint64
	BlocksUsed        uint64
	BlocksFree        uint64
	BlocksUsedPercent float64
	BlocksFreePercent float64
	InodesAll         uint64
	InodesUsed        uint64
	InodesFree        uint64
	InodesUsedPercent float64
	InodesFreePercent float64
}

func BuildDeviceUsage

func BuildDeviceUsage(arr [3]string) (*DeviceUsageStruct, error)

type DiskStats

type DiskStats struct {
	Major             int
	Minor             int
	Device            string
	ReadRequests      uint64 // Total number of reads completed successfully.
	ReadMerged        uint64 // Adjacent read requests merged in a single req.
	ReadSectors       uint64 // Total number of sectors read successfully.
	MsecRead          uint64 // Total number of ms spent by all reads.
	WriteRequests     uint64 // total number of writes completed successfully.
	WriteMerged       uint64 // Adjacent write requests merged in a single req.
	WriteSectors      uint64 // total number of sectors written successfully.
	MsecWrite         uint64 // Total number of ms spent by all writes.
	IosInProgress     uint64 // Number of actual I/O requests currently in flight.
	MsecTotal         uint64 // Amount of time during which ios_in_progress >= 1.
	MsecWeightedTotal uint64 // Measure of recent I/O completion time and backlog.
}

func ListDiskStats

func ListDiskStats() ([]*DiskStats, error)

type Loadavg

type Loadavg struct {
	Avg1min  float64
	Avg5min  float64
	Avg15min float64
}

func LoadAvg

func LoadAvg() (*Loadavg, error)

type Meminfo

type Meminfo struct {
	Buffers   uint64
	Cached    uint64
	MemTotal  uint64
	MemFree   uint64
	SwapTotal uint64
	SwapUsed  uint64
	SwapFree  uint64
}

func MemInfo

func MemInfo() (*Meminfo, error)

type NetIf

type NetIf struct {
	Iface          string
	InBytes        int64
	InPackages     int64
	InErrors       int64
	InDropped      int64
	InFifoErrs     int64
	InFrameErrs    int64
	InCompressed   int64
	InMulticast    int64
	OutBytes       int64
	OutPackages    int64
	OutErrors      int64
	OutDropped     int64
	OutFifoErrs    int64
	OutCollisions  int64
	OutCarrierErrs int64
	OutCompressed  int64
	TotalBytes     int64
	TotalPackages  int64
	TotalErrors    int64
	TotalDropped   int64
}

func NetIfs

func NetIfs() ([]*NetIf, error)

Inter-| Receive | Transmit

face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
 eth0: 1990350    2838    0    0    0     0          0         0   401351    2218    0    0    0     0       0          0
   lo:   26105     286    0    0    0     0          0         0    26105     286    0    0    0     0       0          0

type Proc

type Proc struct {
	Pid     int
	Name    string
	Cmdline string
	State   string
}

func AllProcs

func AllProcs() (ps []*Proc, err error)

Jump to

Keyboard shortcuts

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