Skip to content

Commit b19792c

Browse files
committed
Fix integration tests
1 parent e03de58 commit b19792c

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

extension/prometheus/prometheus.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ import (
99

1010
const namespace = "goengine"
1111

12+
// Metrics is an object for exposing prometheus metrics
1213
type Metrics struct {
1314
notificationCounter *prometheus.CounterVec
1415
notificationQueueDuration *prometheus.HistogramVec
1516
notificationProcessingDuration *prometheus.HistogramVec
1617
notificationStartTimes map[string]time.Time
1718
}
1819

20+
// NewMetrics instantiate and return an object of Metrics
1921
func NewMetrics() *Metrics {
2022
return &Metrics{
2123
// notificationCounter is used to expose 'notification_count' metric
@@ -66,7 +68,7 @@ func (m *Metrics) RegisterMetrics(registry *prometheus.Registry) error {
6668
return registry.Register(m.notificationProcessingDuration)
6769
}
6870

69-
// ReceivedNotification
71+
// ReceivedNotification counts received notifications
7072
func (m *Metrics) ReceivedNotification(isNotification bool) {
7173
labels := prometheus.Labels{"is_notification": strconv.FormatBool(isNotification)}
7274
m.notificationCounter.With(labels).Inc()

metrics_nop.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package goengine
22

3+
// NopMetrics is default Metrics handler in case nil is passed
34
var NopMetrics Metrics = &nopMetrics{}
45

56
type nopMetrics struct{}

test/projector_aggregate_integration_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ func (s *aggregateProjectorTestSuite) TestRunAndListen() {
9393
time.Millisecond,
9494
time.Second,
9595
s.GetLogger(),
96+
s.Metrics,
9697
)
9798
s.Require().NoError(err)
9899

@@ -109,6 +110,7 @@ func (s *aggregateProjectorTestSuite) TestRunAndListen() {
109110
return driverSQL.ProjectionFail
110111
},
111112
s.GetLogger(),
113+
s.Metrics,
112114
)
113115
s.Require().NoError(err, "failed to create projector")
114116

@@ -206,6 +208,7 @@ func (s *aggregateProjectorTestSuite) TestRunAndListen() {
206208
return driverSQL.ProjectionFail
207209
},
208210
s.GetLogger(),
211+
s.Metrics,
209212
)
210213
s.Require().NoError(err, "failed to create projector")
211214

test/projector_stream_integration_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ func (s *streamProjectorTestSuite) TestRunAndListen() {
102102
time.Millisecond,
103103
time.Second,
104104
s.GetLogger(),
105+
s.Metrics,
105106
)
106107
s.Require().NoError(err)
107108

0 commit comments

Comments
 (0)