utilization

package
v3.20.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 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

Overview

Package utilization implements the Utilization spec, available at https://source.datanerd.us/agents/agent-specs/blob/master/Utilization.md

Index

Constants

This section is empty.

Variables

View Source
var (

	// SampleData contains sample utilization data useful for testing.
	SampleData = Data{
		MetadataVersion:   metadataVersion,
		LogicalProcessors: &sampleLogicProc,
		RAMMiB:            &sampleRAMMib,
		Hostname:          "my-hostname",
	}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	DetectAWS         bool
	DetectAzure       bool
	DetectGCP         bool
	DetectPCF         bool
	DetectDocker      bool
	DetectKubernetes  bool
	LogicalProcessors int
	TotalRAMMIB       int
	BillingHostname   string
}

Config controls the behavior of utilization information capture.

type Data

type Data struct {
	MetadataVersion int `json:"metadata_version"`
	// Although `runtime.NumCPU()` will never fail, this field is a pointer
	// to facilitate the cross agent tests.
	LogicalProcessors *int      `json:"logical_processors"`
	RAMMiB            *uint64   `json:"total_ram_mib"`
	Hostname          string    `json:"hostname"`
	FullHostname      string    `json:"full_hostname,omitempty"`
	Addresses         []string  `json:"ip_address,omitempty"`
	BootID            string    `json:"boot_id,omitempty"`
	Config            *override `json:"config,omitempty"`
	Vendors           *vendors  `json:"vendors,omitempty"`
}

Data contains utilization system information.

func Gather

func Gather(config Config, lg logger.Logger) *Data

Gather gathers system utilization data.

Jump to

Keyboard shortcuts

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