From 31d318de7516b608ae881668a7b88c59e3aa2b48 Mon Sep 17 00:00:00 2001 From: Norbert Kwizera Date: Fri, 13 Dec 2024 12:10:40 +0200 Subject: [PATCH] Add CWService interface --- aws/cwatch/service.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aws/cwatch/service.go b/aws/cwatch/service.go index 02f43db..b72780a 100644 --- a/aws/cwatch/service.go +++ b/aws/cwatch/service.go @@ -13,6 +13,13 @@ import ( "github.com/nyaruka/gocommon/syncx" ) +type CWService interface { + Queue(d types.MetricDatum) + StartQueue(wg *sync.WaitGroup) + StopQueue() + Prepare(data []types.MetricDatum) *cloudwatch.PutMetricDataInput +} + type Service struct { Client *cloudwatch.Client namespace string @@ -71,3 +78,5 @@ func (s *Service) processBatch(batch []types.MetricDatum) { slog.Error("error sending metrics to cloudwatch", "error", err, "count", len(batch)) } } + +var _ CWService = (*Service)(nil)