Documentation
¶
Overview ¶
Package cwmetric is the shared shape for services that publish in-process CloudWatch metrics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Async ¶
type Async struct {
// contains filtered or unexported fields
}
Async is a bounded, non-blocking emitter: points queue to one worker and are dropped when full. With a window it folds points per series into statistic sets and flushes once per window.
func NewAsync ¶
NewAsync starts one worker forwarding to inner until ctx is done; window <= 0 forwards every point as-is.
func (*Async) EmitMetric ¶
EmitMetric enqueues p without blocking; a full queue drops it.
type EmitterFunc ¶
EmitterFunc adapts a function to Emitter.
func (EmitterFunc) EmitMetric ¶
func (f EmitterFunc) EmitMetric(p Point) error
EmitMetric implements Emitter.
type Point ¶
type Point struct {
Region string
Namespace string
Name string
Unit string
Dimensions []Dimension
Value float64
// Samples, when positive, marks a statistic set: Samples observations with Sum, Min and Max.
Samples float64
Sum float64
Min float64
Max float64
}
Point is one metric data point published to the CloudWatch backend of Region.
type Sink ¶
type Sink struct {
// contains filtered or unexported fields
}
Sink is a lock-free holder for an optional Emitter, safe to read on hot paths.