metrics

package
v0.0.0-...-955c50f Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudWatchService

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

CloudWatchService encapsulates the client and stop policy as a wrapper to call the CloudWatch API

func NewCloudWatchService

func NewCloudWatchService(context context.T) *CloudWatchService

NewCloudWatchService Creates a new instance of the CloudWatchService

func (*CloudWatchService) GenerateBasicTelemetryMetrics

func (c *CloudWatchService) GenerateBasicTelemetryMetrics(metricName string, value float64, version string) *cloudwatch.MetricDatum

GenerateBasicTelemetryMetrics generate metrics with instance id and AgentVersion as the dimension

func (*CloudWatchService) GenerateUpdateMetrics

func (c *CloudWatchService) GenerateUpdateMetrics(metricName string, value float64, sourceVersion string, targetVersion string) *cloudwatch.MetricDatum

GenerateUpdateMetrics generate metrics with instance id, TargetVersion and SourceVersion as the dimension

func (*CloudWatchService) IsCloudWatchEnabled

func (c *CloudWatchService) IsCloudWatchEnabled() bool

IsCloudWatchEnabled returns whether the agent telemetry to cloud watch is enabled or not

func (*CloudWatchService) PutMetrics

func (c *CloudWatchService) PutMetrics(metricData []*cloudwatch.MetricDatum) error

PutMetrics publishes the metrics to CloudWatch

type ICloudWatchService

type ICloudWatchService interface {
	GenerateUpdateMetrics(metricName string, value float64, sourceVersion string, targetVersion string) *cloudwatch.MetricDatum
	GenerateBasicTelemetryMetrics(metricName string, value float64, version string) *cloudwatch.MetricDatum
	PutMetrics(metricData []*cloudwatch.MetricDatum) error
	IsCloudWatchEnabled() bool
}

ICloudWatchService is the interface to create and push cloud watch metrics

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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