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 f660897
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions aws/cwatch/base.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package cwatch

import (
"sync"

"github.com/aws/aws-sdk-go-v2/service/cloudwatch"
"github.com/aws/aws-sdk-go-v2/service/cloudwatch/types"
)

type CWService interface {
Queue(d types.MetricDatum)
StartQueue(wg *sync.WaitGroup)
StopQueue()
Prepare(data []types.MetricDatum) *cloudwatch.PutMetricDataInput
}
2 changes: 2 additions & 0 deletions aws/cwatch/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,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 f660897

Please sign in to comment.