stats

package
v2.123.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPULoad

type CPULoad struct {
	One     float64
	Five    float64
	Fifteen float64
}

type CPUStats

type CPUStats struct {
	User  uint64
	Nice  uint64
	Sys   uint64
	Wait  uint64
	Total uint64
}

func (CPUStats) SysPercent

func (cpuStats CPUStats) SysPercent() Percentage

func (CPUStats) UserPercent

func (cpuStats CPUStats) UserPercent() Percentage

func (CPUStats) WaitPercent

func (cpuStats CPUStats) WaitPercent() Percentage

type Collector

type Collector interface {
	StartCollecting(time.Duration, chan struct{})

	GetCPULoad() (load CPULoad, err error)
	GetCPUStats() (stats CPUStats, err error)

	GetMemStats() (usage Usage, err error)
	GetSwapStats() (usage Usage, err error)
	GetDiskStats(mountedPath string) (stats DiskStats, err error)

	GetUptimeStats() (stats UptimeStats, err error)
}

func NewDummyStatsCollector

func NewDummyStatsCollector() (collector Collector)

type DiskStats

type DiskStats struct {
	DiskUsage  Usage
	InodeUsage Usage
}

type Percentage

type Percentage struct {
	// contains filtered or unexported fields
}

func NewPercentage

func NewPercentage(part, total uint64) (percentage Percentage)

func (Percentage) FormatFractionOf100

func (p Percentage) FormatFractionOf100(numberOfDecimals int) string

func (Percentage) FractionOf100

func (p Percentage) FractionOf100() float64

type UptimeStats

type UptimeStats struct {
	Secs uint64
}

type Usage

type Usage struct {
	Used  uint64
	Total uint64
}

func (Usage) Percent

func (usage Usage) Percent() Percentage

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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