metrics

package
v0.0.0-...-b52cbd8 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package metrics defines the instrumentation metrics for this program.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client groups the custom collectors to be shared with other packages.

func New

func New() *Client

New creates a new Metrics instance.

func (*Client) CreateMetricsClientFunc

func (m *Client) CreateMetricsClientFunc() (metrics.Client, error)

CreateMetricsClientFunc returns the metrics Client.

func (*Client) SetDiskFree

func (m *Client) SetDiskFree(v uint64)

SetDiskFree sets the total free disk space in bytes.

func (*Client) SetDiskTotal

func (m *Client) SetDiskTotal(v uint64)

SetDiskTotal sets the total disk size in bytes.

func (*Client) SetLoad1

func (m *Client) SetLoad1(v float64)

SetLoad1 sets the 1 minute CPU load average.

func (*Client) SetLoad15

func (m *Client) SetLoad15(v float64)

SetLoad15 sets the 15 minutes CPU load average.

func (*Client) SetLoad5

func (m *Client) SetLoad5(v float64)

SetLoad5 sets the 5 minutes CPU load average.

func (*Client) SetMemoryFree

func (m *Client) SetMemoryFree(v uint64)

SetMemoryFree sets the total free memory in bytes.

func (*Client) SetMemoryTotal

func (m *Client) SetMemoryTotal(v uint64)

SetMemoryTotal sets the total available memory in bytes.

func (*Client) SetNetwork

func (m *Client) SetNetwork(nic string, rx uint64, tx uint64)

SetNetwork sets the network received and transmitted bytes for the specified NIC.

func (*Client) SetTempCPU

func (m *Client) SetTempCPU(v float64)

SetTempCPU sets the CPU Temperature in Celsius Degrees.

func (*Client) SetUptime

func (m *Client) SetUptime(v time.Duration)

SetUptime sets the time elapsed since last system boot.

type Metrics

type Metrics interface {
	CreateMetricsClientFunc() (metrics.Client, error)
	SetUptime(v time.Duration)
	SetMemoryTotal(v uint64)
	SetMemoryFree(v uint64)
	SetLoad1(v float64)
	SetLoad5(v float64)
	SetLoad15(v float64)
	SetTempCPU(v float64)
	SetDiskTotal(v uint64)
	SetDiskFree(v uint64)
	SetNetwork(nic string, rx uint64, tx uint64)
}

Metrics is the interface for the custom metrics.

Jump to

Keyboard shortcuts

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