collector

package
v0.0.0-...-3f1c2bf Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GatherUptime

func GatherUptime(hs *HelperStruct, _ *Logger.Logger, client aws.MetricClient, name string) (map[string]interface{}, error)

GatherUptime gathers uptime information about autoscaling group

func GetLoadBalancerRequestCount

func GetLoadBalancerRequestCount(hs *HelperStruct, logger *Logger.Logger, client aws.MetricClient, name string) (map[string]interface{}, error)

GetLoadBalancerRequestCount retrieves load balancer request count

func GetTargetGroupRequestCount

func GetTargetGroupRequestCount(hs *HelperStruct, logger *Logger.Logger, client aws.MetricClient, name string) (map[string]interface{}, error)

GetTargetGroupRequestCount retrieves target group request count

Types

type Collector

type Collector struct {
	MetricConfig      schemas.MetricConfig
	MetricClient      aws.MetricClient
	TargetMetricsList []TargetMetrics
}

func NewCollector

func NewCollector(mc schemas.MetricConfig, assumeRole string) Collector

NewCollector creates new collector

func (Collector) CheckStorage

func (c Collector) CheckStorage(logger *Logger.Logger) error

CheckStorage is for checking metrics storage

func (Collector) GetAdditionalMetric

func (c Collector) GetAdditionalMetric(asg string, tgs []*string, lbs []*string, logger *Logger.Logger) (map[string]interface{}, error)

GetAdditionalMetric retrieves additional metrics to store

func (Collector) StampDeployment

func (c Collector) StampDeployment(stack schemas.Stack, config schemas.Config, tags []*autoscaling.Tag, asg string, status string, additionalFields map[string]string) error

StampDeployment records deployment information to storage

func (Collector) UpdateStatistics

func (c Collector) UpdateStatistics(asg string, updateFields map[string]interface{}) error

UpdateStatistics update value of metric table

func (Collector) UpdateStatus

func (c Collector) UpdateStatus(asg string, status string, updateFields map[string]interface{}) error

UpdateStatus updates status of deployment on the table

type HelperStruct

type HelperStruct struct {
	BaseTimeDuration float64
	StartDate        time.Time
	AutoScalingGroup string
	CurrentTime      time.Time
	TargetGroups     []*string
	LoadBalancers    []*string
	Storage          string
}

type TargetMetrics

type TargetMetrics struct {
	// Metric name
	Name string

	// Enable
	Enable bool

	// Mapping function for metric
	MappingFunction func(*HelperStruct, *Logger.Logger, aws.MetricClient, string) (map[string]interface{}, error)
}

Detailed metric structure

func SetTargetMetrics

func SetTargetMetrics() []TargetMetrics

SetTargetMetrics sets what collector will gather for measurement

Jump to

Keyboard shortcuts

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