stats

package
v2.900.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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