performance

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: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceName      = "AmazonCloudWatchAgent"
	DynamoDBDataBase = "CWAPerformanceMetrics"
)

Variables

This section is empty.

Functions

func NewPerformanceValidator

func NewPerformanceValidator(vConfig models.ValidateConfig) models.ValidatorFactory

Types

type PerformanceInformation

type PerformanceInformation map[string]interface{}

type PerformanceValidator

type PerformanceValidator struct {
	models.ValidatorFactory
	// contains filtered or unexported fields
}

func (*PerformanceValidator) CalculateMetricStatsAndPackMetrics

func (s *PerformanceValidator) CalculateMetricStatsAndPackMetrics(metrics []types.MetricDataResult) (PerformanceInformation, error)

func (*PerformanceValidator) CalculateWindowsMetricStatsAndPackMetrics

func (s *PerformanceValidator) CalculateWindowsMetricStatsAndPackMetrics(statistic []*cloudwatch.GetMetricStatisticsOutput) (PerformanceInformation, error)

func (*PerformanceValidator) CheckData

func (s *PerformanceValidator) CheckData(startTime, endTime time.Time) error

func (*PerformanceValidator) GetPerformanceMetrics

func (s *PerformanceValidator) GetPerformanceMetrics(startTime, endTime time.Time) ([]types.MetricDataResult, error)

func (*PerformanceValidator) GetWindowsPerformanceMetrics

func (s *PerformanceValidator) GetWindowsPerformanceMetrics(startTime, endTime time.Time) ([]*cloudwatch.GetMetricStatisticsOutput, error)

func (*PerformanceValidator) SendPacketToDatabase

func (s *PerformanceValidator) SendPacketToDatabase(perfInfo PerformanceInformation) error

type Stats

type Stats struct {
	Average float64
	P99     float64 //99% percent process
	Max     float64
	Min     float64
	Period  int //in seconds
	Std     float64
}

func CalculateMetricStatisticsBasedOnDataAndPeriod

func CalculateMetricStatisticsBasedOnDataAndPeriod(data []float64, dataPeriod float64) Stats

CalculateMetricStatisticsBasedOnDataAndPeriod takes in an array of data and returns the average, min, max, p99, and stdev of the data. statistics are calculated this way instead of using GetMetricStatistics API because GetMetricStatistics would require multiple API calls as only one metric can be requested/processed at a time whereas all metrics can be requested in one GetMetricData request.

Jump to

Keyboard shortcuts

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