metrics

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	CollectStart time.Time
	// contains filtered or unexported fields
}

Metrics represents a collection of oids, plus additional data about the environment.

func New

func New(client snmp.Client, config config.Config, target string, hostname string) *Metrics

New creates a new metrics.Metrics struct with various OID maps initialized.

func (*Metrics) Collect

func (metrics *Metrics) Collect(client snmp.Client, config config.Config) error

Collect scrapes values for a list of OIDs and updates a map of OIDs, appending a new archive.Sample representing the increase from the previous scrape to an slice of samples for that OID.

func (*Metrics) Write

func (metrics *Metrics) Write(dataDir string)

Write collects JSON data for all OIDs and then writes the result to an archive.

Jump to

Keyboard shortcuts

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