metrics

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package metrics handles sending metrics about resource providers to CloudWatch

Index

Constants

View Source
const (
	// MetricNameSpaceRoot is the Metric name space root.
	MetricNameSpaceRoot = "AWS_TMP/CloudFormation"
	//MetricNameHanderException  is a metric type.
	MetricNameHanderException = "HandlerException"
	//MetricNameHanderDuration is a metric type.
	MetricNameHanderDuration = "HandlerInvocationDuration"
	//MetricNameHanderInvocationCount is a metric type.
	MetricNameHanderInvocationCount = "HandlerInvocationCount"
	//DimensionKeyAcionType  is the Action key in the dimension.
	DimensionKeyAcionType = "Action"
	//DimensionKeyExceptionType  is the ExceptionType in the dimension.
	DimensionKeyExceptionType = "ExceptionType"
	//DimensionKeyResouceType  is the ResourceType in the dimension.
	DimensionKeyResouceType = "ResourceType"
	//ServiceInternalError ...
	ServiceInternalError string = "ServiceInternal"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Publisher

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

A Publisher represents an object that publishes metrics to AWS Cloudwatch.

func New

New creates a new Publisher.

func (*Publisher) PublishDurationMetric

func (p *Publisher) PublishDurationMetric(date time.Time, action string, secs float64) error

PublishDurationMetric publishes an duration metric.

A duration metric is the timing of something.

func (*Publisher) PublishExceptionMetric

func (p *Publisher) PublishExceptionMetric(date time.Time, action string, e error) error

PublishExceptionMetric publishes an exception metric.

func (*Publisher) PublishInvocationMetric

func (p *Publisher) PublishInvocationMetric(date time.Time, action string) error

PublishInvocationMetric publishes an invocation metric.

func (*Publisher) SetResourceTypeName

func (p *Publisher) SetResourceTypeName(t string)

SetResourceTypeName returns a type name by removing (::) and replaing with (/)

Example

pub := metrics.New(cw)

// Will return "AWS/Service/Resource"
pub.SetResourceTypeName("AWS::Service::Resource")

Jump to

Keyboard shortcuts

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