cloudwatch

package
v0.0.0-...-8d97d4a Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package cloudwatch defines structures for interacting with Cloudwatch Metrics.

Index

Constants

View Source
const DefaultConcurrency = 4
View Source
const DefaultExpansionLimit = 500
View Source
const DefaultPageLimit = 10

Variables

View Source
var ErrExpansionLimit = errors.New("Hit dimension expansion limit")
View Source
var ErrInvalidPeriod = errors.New("Period must be greater than 0")
View Source
var ErrPagingLimit = errors.New("Hit the page limit when retrieving metrics")

Functions

This section is empty.

Types

type Context

type Context interface {
	Query(*Request) (Response, error)
	LookupDimensions(request *LookupRequest) ([][]Dimension, error)
	GetExpansionLimit() int
	GetPagesLimit() int
	GetConcurrency() int
}

Context is the interface for querying CloudWatch.

func GetContext

func GetContext() Context

func GetContextWithProvider

func GetContextWithProvider(p ProfileProvider) Context

type DataPoint

type DataPoint struct {
	Aggregator string
	Timestamp  string
	Unit       string
}

type Dimension

type Dimension struct {
	Name  string
	Value string
}

func (Dimension) String

func (d Dimension) String() string

type DimensionList

type DimensionList struct {
	Groups [][]Dimension
}

type DimensionSet

type DimensionSet map[string]bool

type LookupRequest

type LookupRequest struct {
	Region     string
	Namespace  string
	Metric     string
	Dimensions [][]Dimension
	Profile    string
}

type ProfileProvider

type ProfileProvider interface {
	NewProfile(name, region string) cwi.CloudWatchAPI
}

type Request

type Request struct {
	Start           *time.Time
	End             *time.Time
	Region          string
	Namespace       string
	Metric          string
	Period          int64
	Statistic       string
	DimensionString string
	Dimensions      [][]Dimension
	Profile         string
}

Request holds query objects. Currently only absolute times are supported.

func (*Request) CacheKey

func (r *Request) CacheKey() string

type Response

type Response struct {
	Raw    cw.GetMetricDataOutput
	TagSet map[string]opentsdb.TagSet
}

type Series

type Series struct {
	Datapoints []DataPoint
	Label      string
}

type Wildcards

type Wildcards map[string]string

Jump to

Keyboard shortcuts

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