cloudwatch

package
v3.0.0-...-bcda2dc Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package cloudwatch scopes CloudWatch-specific utiltities for Sparta

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterLambdaUtilizationMetricPublisher

func RegisterLambdaUtilizationMetricPublisher(customDimensionMap map[string]string)

RegisterLambdaUtilizationMetricPublisher installs a periodic task to publish the current system metrics to CloudWatch Metrics.

Types

type EmbeddedMetric

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

EmbeddedMetric represents an embedded metric that should be published

func NewEmbeddedMetric

func NewEmbeddedMetric() (*EmbeddedMetric, error)

NewEmbeddedMetric returns a new fully initialized embedded metric. Callers should populate the Fields

func NewEmbeddedMetricWithProperties

func NewEmbeddedMetricWithProperties(props map[string]interface{}) (*EmbeddedMetric, error)

NewEmbeddedMetricWithProperties returns an EmbeddedMetric with the user supplied properties

func (*EmbeddedMetric) MarshalJSON

func (em *EmbeddedMetric) MarshalJSON() ([]byte, error)

MarshalJSON is a custom marshaller to ensure that the marshalled headers are always lowercase

func (*EmbeddedMetric) NewMetricDirective

func (em *EmbeddedMetric) NewMetricDirective(namespace string,
	dimensions map[string]string) *MetricDirective

NewMetricDirective returns an initialized MetricDirective that's included in the EmbeddedMetric instance

func (*EmbeddedMetric) Publish

func (em *EmbeddedMetric) Publish(additionalProperties map[string]interface{})

Publish the metric to the logfile

func (*EmbeddedMetric) PublishToSink

func (em *EmbeddedMetric) PublishToSink(additionalProperties map[string]interface{},
	sink io.Writer)

PublishToSink writes the EmbeddedMetric info to the provided writer

func (*EmbeddedMetric) WithProperty

func (em *EmbeddedMetric) WithProperty(key string, value interface{}) *EmbeddedMetric

WithProperty is a fluent builder to add property to the EmbeddedMetric state. Properties should be used for high cardintality values that need to be searchable, but not treated as independent metrics

type MetricDirective

type MetricDirective struct {
	// Dimensions corresponds to the JSON schema field "Dimensions".
	Dimensions map[string]string

	// Metrics corresponds to the JSON schema field "Metrics".
	Metrics map[string]MetricValue
	// contains filtered or unexported fields
}

MetricDirective is the directive that encapsulates a metric

type MetricUnit

type MetricUnit string

MetricUnit Represents a MetricUnit type

const (
	// UnitSeconds Seconds
	UnitSeconds MetricUnit = "Seconds"
	// UnitMicroseconds Microseconds
	UnitMicroseconds MetricUnit = "Microseconds"
	// UnitMilliseconds Milliseconds
	UnitMilliseconds MetricUnit = "Milliseconds"
	// UnitBytes Bytes
	UnitBytes MetricUnit = "Bytes"
	//UnitKilobytes Kilobytes
	UnitKilobytes MetricUnit = "Kilobytes"
	//UnitMegabytes Megabytes
	UnitMegabytes MetricUnit = "Megabytes"
	//UnitGigabytes Gigabytes
	UnitGigabytes MetricUnit = "Gigabytes"
	//UnitTerabytes Terabytes
	UnitTerabytes MetricUnit = "Terabytes"
	//UnitBits Bits
	UnitBits MetricUnit = "Bits"
	//UnitKilobits Kilobits
	UnitKilobits MetricUnit = "Kilobits"
	//UnitMegabits Megabits
	UnitMegabits MetricUnit = "Megabits"
	//UnitGigabits Gigabits
	UnitGigabits MetricUnit = "Gigabits"
	//UnitTerabits Terabits
	UnitTerabits MetricUnit = "Terabits"
	//UnitPercent Percent
	UnitPercent MetricUnit = "Percent"
	//UnitCount Count
	UnitCount MetricUnit = "Count"
	//UnitBytesPerSecond BytesPerSecond
	UnitBytesPerSecond MetricUnit = "Bytes/Second"
	//UnitKilobytesPerSecond KilobytesPerSecond
	UnitKilobytesPerSecond MetricUnit = "Kilobytes/Second"
	//UnitMegabytesPerSecond MegabytesPerSecond
	UnitMegabytesPerSecond MetricUnit = "Megabytes/Second"
	//UnitGigabytesPerSecond GigabytesPerSecond
	UnitGigabytesPerSecond MetricUnit = "Gigabytes/Second"
	//UnitTerabytesPerSecond TerabytesPerSecond
	UnitTerabytesPerSecond MetricUnit = "Terabytes/Second"
	//UnitBitsPerSecond BitsPerSecond
	UnitBitsPerSecond MetricUnit = "Bits/Second"
	//UnitKilobitsPerSecond KilobitsPerSecond
	UnitKilobitsPerSecond MetricUnit = "Kilobits/Second"
	//UnitMegabitsPerSecond MegabitsPerSecond
	UnitMegabitsPerSecond MetricUnit = "Megabits/Second"
	//UnitGigabitsPerSecond GigabitsPerSecond
	UnitGigabitsPerSecond MetricUnit = "Gigabits/Second"
	//UnitTerabitsPerSecond TerabitsPerSecond
	UnitTerabitsPerSecond MetricUnit = "Terabits/Second"
	//UnitCountPerSecond CountPerSecond
	UnitCountPerSecond MetricUnit = "Count/Second"
	// UnitNone No units
	UnitNone MetricUnit = "None"
)

type MetricValue

type MetricValue struct {
	Value interface{}
	Unit  MetricUnit
}

MetricValue represents a metric value

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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