Skip to content

Commit

Permalink
Update CheckObservations
Browse files Browse the repository at this point in the history
  • Loading branch information
Vamsi-Mundra committed May 7, 2024
1 parent 4aec059 commit 8133b8f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions go-kit/metrics/testmetrics/provider.go
Expand Up @@ -181,8 +181,14 @@ func (p *Provider) CheckObservations(name string, obs []float64, labelValues ...
p.t.Helper()

observations := p.getObservations(name, labelValues...)
if !reflect.DeepEqual(observations, obs) {
p.t.Fatalf("%v = %v, want %v", p.keyFor(name, labelValues...), observations, obs)
got := make([]float64, len(observations))
copy(got, observations)

want := make([]float64, len(obs))
copy(want, obs)

if !reflect.DeepEqual(got, want) {
p.t.Fatalf("%v = %v, want %v", p.keyFor(name, labelValues...), got, want)
}
}

Expand Down

0 comments on commit 8133b8f

Please sign in to comment.