collector

package
v5.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScheduledJobsCount  = "ScheduledJobsCount"
	RunningJobsCount    = "RunningJobsCount"
	UnfinishedJobsCount = "UnfinishedJobsCount"
	WaitingJobsCount    = "WaitingJobsCount"
	IdleAgentCount      = "IdleAgentCount"
	BusyAgentCount      = "BusyAgentCount"
	TotalAgentCount     = "TotalAgentCount"
	BusyAgentPercentage = "BusyAgentPercentage"

	PollDurationHeader = `Buildkite-Agent-Metrics-Poll-Duration`
)

Variables

Functions

func NewHTTPClient added in v5.9.6

func NewHTTPClient(timeout, maxIdleConns int) *http.Client

Types

type Collector

type Collector struct {
	Client    *http.Client
	Endpoint  string
	Token     string
	UserAgent string
	Queues    []string
	Quiet     bool
	Debug     bool
	DebugHttp bool
}

func (*Collector) Collect

func (c *Collector) Collect() (*Result, error)

type HTTPError added in v5.11.0

type HTTPError struct {
	StatusCode int    `json:"-"`
	Message    string `json:"message"`
}

func (HTTPError) Error added in v5.11.0

func (e HTTPError) Error() string

type Result

type Result struct {
	Totals       map[string]int
	Queues       map[string]map[string]int
	Org          string
	Cluster      string
	PollDuration time.Duration
}

func (Result) Dump

func (r Result) Dump()

Jump to

Keyboard shortcuts

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