getmetricdata

package
v0.59.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const TimeFormat = "2006-01-02T15:04:05.999999-07:00"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetMetricData(ctx context.Context, getMetricData []*model.CloudwatchData, namespace string, startTime time.Time, endTime time.Time) []cloudwatch.MetricDataResult
}

type Clock added in v0.59.0

type Clock interface {
	Now() time.Time
}

Clock small interface which allows for stubbing the time.Now() function for unit testing

type MetricWindowCalculator added in v0.59.0

type MetricWindowCalculator struct {
	// contains filtered or unexported fields
}

func (MetricWindowCalculator) Calculate added in v0.59.0

func (m MetricWindowCalculator) Calculate(period time.Duration, length time.Duration, delay time.Duration) (time.Time, time.Time)

Calculate computes the start and end time for the GetMetricData request to AWS Always uses the wall clock time as starting point for calculations to ensure that a variety of exporter configurations will work reliably.

type Processor

type Processor struct {
	// contains filtered or unexported fields
}

func NewDefaultProcessor added in v0.59.0

func NewDefaultProcessor(logger logging.Logger, client Client, metricsPerQuery int, concurrency int) Processor

func NewProcessor

func NewProcessor(logger logging.Logger, client Client, metricsPerQuery int, concurrency int, windowCalculator MetricWindowCalculator) Processor

func (Processor) Run

func (p Processor) Run(ctx context.Context, namespace string, jobMetricLength, jobMetricDelay int64, jobRoundingPeriod *int64, requests []*model.CloudwatchData) ([]*model.CloudwatchData, error)

type TimeClock added in v0.59.0

type TimeClock struct{}

TimeClock implementation of Clock interface which delegates to Go's Time package

func (TimeClock) Now added in v0.59.0

func (tc TimeClock) Now() time.Time

Jump to

Keyboard shortcuts

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