uptime

package
v0.0.0-...-63a22fc Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package uptime provides utilities to read and analyse Linux uptime values Learn more at https://man7.org/linux/man-pages/man5/proc.5.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UptimeProbe

type UptimeProbe struct {
	Uptime   time.Duration
	Idle     time.Duration
	CPUCount int
}

func NewUptimeProbe

func NewUptimeProbe(CPUCount int) (*UptimeProbe, error)

NewUptimeProbe reads the uptime data and returns a struct representation

func (*UptimeProbe) Analysis

func (u *UptimeProbe) Analysis() (observations []*analysis.Observation)

func (*UptimeProbe) Display

func (u *UptimeProbe) Display() string

func (*UptimeProbe) Utilization

func (u *UptimeProbe) Utilization() float64

Utilization returns ratio spent outside Idle process since boot averaged out by the number of cpus

Jump to

Keyboard shortcuts

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