metrics

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderFactories = map[ProviderType]ProviderFactory{
	"aws": func() (Provider, error) { return aws.NewAwsCloudWatch() },
	"gcp": func() (Provider, error) { return gcp.NewGCP() },
}

Functions

func ResourceIDFromSelector added in v0.18.0

func ResourceIDFromSelector(obj *entities.Selector) string

ResourceFromSelector - identifies the resource ID from the given selector returns empty string if resource cannot be determined

Types

type Provider

type Provider interface {
	Get99PercentLatencyMetricForResource(resourceID string, from, to time.Time) (float64, error)
	GetErrorPercentageMetricForResource(resourceID string, from, to time.Time) (float64, error)

	GetLatencyAboveThresholdPercentage(resourceID string, from, to time.Time, threshold int) (float64, error)
	GetAvailabilityPercentage(resourceID string, from, to time.Time) (float64, error)

	// Note that this function must return an empty
	// string if resource cannot be determined
	ResourceFromSelector(entities.Selector) string
	Close() error // providers must explicitly be closed once not needed anymore

}

func FromSelector added in v0.18.0

func FromSelector(obj *entities.Selector) Provider

FromSelector - identifies provider from Objective returns nil if provider cannot be identified

type ProviderFactory

type ProviderFactory func() (Provider, error)

type ProviderType added in v0.18.0

type ProviderType string
const (
	AWSProvider ProviderType = "aws"
	GCPProvider ProviderType = "gcp"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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