Documentation ¶
Index ¶
Constants ¶
const ( DefaultMetricFileNameSuffix = "doctor-metrics.json" DefaultFileRotationInterval = 1 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudWatchCollector ¶
type CloudWatchCollector struct {
// contains filtered or unexported fields
}
CloudWatchCollector implements the Collector interface, collecting metrics to a file
func NewCloudWatchCollector ¶
func NewCloudWatchCollector(config CloudWatchCollectorConfig) (*CloudWatchCollector, error)
NewCloudWatchCollector attempts to create a new CloudWatchCollector using the specified config returning the CloudWatchCollector and error (if any)
type CloudWatchCollectorConfig ¶
type CloudWatchCollectorConfig struct { Ctx context.Context AWSRegion string MetricNamespace string }
CloudWatchCollectorConfig wraps values for configuring a CloudWatch
type Collector ¶
Collector allows for collecting a metric to an arbitrary metric sink (e.g. a file or AWS CloudWatch) for historical and real time monitoring purposes
type FileCollector ¶
type FileCollector struct {
// contains filtered or unexported fields
}
FileCollector implements the Collector interface, collecting metrics to a file
func NewFileCollector ¶
func NewFileCollector(config FileCollectorConfig) (*FileCollector, error)
NewFileCollector attempts to create a new FileCollector using the specified config (or default values where appropriate) returning the FileCollector and error (if any)
func (*FileCollector) Collect ¶
func (fc *FileCollector) Collect(metric metric.Metric) error
Collect collects metric to a file, returning error (if any) Collect will ensure that the file is rotated at most `fileRotationInterval` (rotation is only triggered when a metric is collection) Collect is safe to call across go-routines, and will block to ensure an in progress collection completes cleanly before a new metric is collected
type FileCollectorConfig ¶
FileCollectorConfig wraps values for configuring a FileCollector