go-agent: github.com/newrelic/go-agent/v3/internal/utilization Index | Files

package utilization

import "github.com/newrelic/go-agent/v3/internal/utilization"

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


Package Files

addresses.go aws.go azure.go fqdn.go gcp.go pcf.go provider.go utilization.go


var (

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

type Config Uses

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

Config controls the behavior of utilization information capture.

type Data Uses

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 Uses

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

Gather gathers system utilization data.

Package utilization imports 14 packages (graph) and is imported by 2 packages. Updated 2021-01-19. Refresh now. Tools for package owners.