utilization

package
v0.0.0-...-51c1140 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GatherAWS

func GatherAWS(util *Data) error

func GatherAzure

func GatherAzure(util *Data) error

func GatherBootID

func GatherBootID(util *Data) error

func GatherCPU

func GatherCPU(util *Data) error

func GatherDockerID

func GatherDockerID(util *Data) error

func GatherGCP

func GatherGCP(util *Data) error

func GatherKubernetes

func GatherKubernetes(v *vendors, getenv func(string) string) error

func GatherMemory

func GatherMemory(util *Data) error

func GatherPCF

func GatherPCF(util *Data) error

func GetDockerId

func GetDockerId(util *Data) (string, error)

func OverrideDockerId

func OverrideDockerId(util *Data, id string) error

func OverrideVendors

func OverrideVendors(util *Data)

Types

type Config

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

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"`
}

func Gather

func Gather(config Config) *Data

Jump to

Keyboard shortcuts

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