metrics

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package metrics implements the CPU metrics collection and reporting.

Index

Constants

View Source
const SubSystem = "cpu"

Variables

This section is empty.

Functions

func InitAveragers

func InitAveragers(db *sql.DB, tableName string)

func ReadLoadAverage5mins

func ReadLoadAverage5mins(ctx context.Context, since time.Time) (components_metrics_state.Metrics, error)

func ReadUsedPercents

func ReadUsedPercents(ctx context.Context, since time.Time) (components_metrics_state.Metrics, error)

func Register

func Register(reg *prometheus.Registry, db *sql.DB, tableName string) error

func SetLastUpdateUnixSeconds

func SetLastUpdateUnixSeconds(unixSeconds float64)

func SetLoadAverage

func SetLoadAverage(ctx context.Context, duration time.Duration, avg float64, currentTime time.Time) error

func SetUsedPercent

func SetUsedPercent(ctx context.Context, pct float64, currentTime time.Time) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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