metric

package
v0.0.0-...-c638bfa Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT-0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContainerInsightsNamespace = "ContainerInsights"
)

Variables

View Source
var (
	AppSignalsMetricNames = []string{
		"Error",
		"Fault",
		"Latency",
	}

	ServerConsumerInstructions = []dimension.Instruction{
		{
			Key:   "Service",
			Value: dimension.ExpectedDimensionValue{Value: aws.String("service-name")},
		},
		{
			Key:   "Operation",
			Value: dimension.ExpectedDimensionValue{Value: aws.String("replaced-operation")},
		},
	}

	ClientProducerInstructions = []dimension.Instruction{
		{
			Key:   "Service",
			Value: dimension.ExpectedDimensionValue{Value: aws.String("service-name")},
		},
		{
			Key:   "RemoteService",
			Value: dimension.ExpectedDimensionValue{Value: aws.String("service-name-remote")},
		},
		{
			Key:   "Operation",
			Value: dimension.ExpectedDimensionValue{Value: aws.String("replaced-operation")},
		},
		{
			Key:   "RemoteOperation",
			Value: dimension.ExpectedDimensionValue{Value: aws.String("remote-operation")},
		},
		{
			Key:   "RemoteTarget",
			Value: dimension.ExpectedDimensionValue{Value: aws.String("remote-target")},
		},
	}
)
View Source
var (
	// metric name must use "_"" as a separator and include the metric type.
	StatsdMetricNames = []string{
		"statsd_counter_1",
		"statsd_gauge_2",
		"statsd_timing_3",
		"statsd_counter_4",
		"statsd_gauge_5",
		"statsd_timing_6",
	}
	StatsdMetricValues = []float64{1000, 2000, 3000, 4000, 5000, 6000}
)
View Source
var CpuMetrics = []string{"cpu_time_active", "cpu_time_guest", "cpu_time_guest_nice", "cpu_time_idle", "cpu_time_iowait", "cpu_time_irq",
	"cpu_time_nice", "cpu_time_softirq", "cpu_time_steal", "cpu_time_system", "cpu_time_user",
	"cpu_usage_active", "cpu_usage_guest", "cpu_usage_guest_nice", "cpu_usage_idle", "cpu_usage_iowait",
	"cpu_usage_irq", "cpu_usage_nice", "cpu_usage_softirq", "cpu_usage_steal", "cpu_usage_system", "cpu_usage_user"}

Functions

func IsAllValuesGreaterThanOrEqualToExpectedValue

func IsAllValuesGreaterThanOrEqualToExpectedValue(metricName string, values []float64, expectedValue float64) bool

IsAllValuesGreaterThanOrEqualToExpectedValue will compare if the given array is larger than 0 and check if the average value for the array is not la https://github.com/aws/amazon-cloudwatch-agent-test/pull/162

func ValidateAppSignalsMetric

func ValidateAppSignalsMetric(dimFactory dimension.Factory, namespace string, metricName string, instructions []dimension.Instruction) status.TestResult

func ValidateLogs

func ValidateLogs(env *environment.MetaData) status.TestResult

func ValidateMetrics

func ValidateMetrics(env *environment.MetaData, metricFilter string, expectedDimsToMetrics map[string][]string) []status.TestResult

func ValidateStatsdMetric

func ValidateStatsdMetric(dimFactory dimension.Factory, namespace string, dimensionKey string, metricName string, expectedValue float64, runDuration time.Duration, sendInterval time.Duration) status.TestResult

Types

type Fetcher

type Fetcher struct {
}

func (*Fetcher) Fetch

func (n *Fetcher) Fetch(namespace, metricName string, dimensions []types.Dimension) ([]types.Metric, error)

type MetricValueFetcher

type MetricValueFetcher struct {
}

func (*MetricValueFetcher) Fetch

func (n *MetricValueFetcher) Fetch(namespace, metricName string, metricSpecificDimensions []types.Dimension, stat Statistics, metricQueryPeriod int32) (MetricValues, error)

type MetricValues

type MetricValues []float64

type Statistics

type Statistics string
const (
	AVERAGE                  Statistics = "Average"
	SAMPLE_COUNT             Statistics = "SampleCount"
	MINIMUM                  Statistics = "Minimum"
	MAXUMUM                  Statistics = "Maxmimum"
	SUM                      Statistics = "Sum"
	HighResolutionStatPeriod            = 10
	MinuteStatPeriod                    = 60
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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