Skip to content

Commit

Permalink
Add CWService interface
Browse files Browse the repository at this point in the history
  • Loading branch information
norkans7 committed Dec 13, 2024
1 parent c430b1e commit 31d318d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions aws/cwatch/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

0 comments on commit 31d318d

Please sign in to comment.