We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f016ea2 + d2db6af commit b125e2eCopy full SHA for b125e2e
internal/metrics/metrics.go
@@ -79,7 +79,6 @@ func Init(iterationMetricsEnabled bool) {
79
}
80
m = NewInstance(defaultRegistry, iterationMetricsEnabled)
81
})
82
- m.IterationMetricsEnabled = iterationMetricsEnabled
83
84
85
func Instance() *Metrics {
internal/metrics/metrics_test.go
@@ -0,0 +1,24 @@
1
+package metrics_test
2
+
3
+import (
4
+ "testing"
5
6
+ "github.com/stretchr/testify/assert"
7
8
+ "github.com/form3tech-oss/f1/v2/internal/metrics"
9
+)
10
11
+func TestMetrics_Init_IsSafe(t *testing.T) {
12
+ t.Parallel()
13
14
+ metrics.Init(true)
15
16
+ // race detector assertion
17
+ for range 10 {
18
+ go func() {
19
+ metrics.Init(false)
20
+ }()
21
+ }
22
23
+ assert.True(t, metrics.Instance().IterationMetricsEnabled)
24
+}
0 commit comments