(t *testing.T)
| 12 | ) |
| 13 | |
| 14 | func TestSendUrl(t *testing.T) { |
| 15 | observer := NewObserver(&log, &log) |
| 16 | |
| 17 | observer.SendURL("my-url.com") |
| 18 | assert.Equal(t, 1.0, getCounterValue(t, observer.metrics.userHostnamesCounts, "https://my-url.com")) |
| 19 | |
| 20 | observer.SendURL("https://another-long-one.com") |
| 21 | assert.Equal(t, 1.0, getCounterValue(t, observer.metrics.userHostnamesCounts, "https://another-long-one.com")) |
| 22 | } |
| 23 | |
| 24 | func getCounterValue(t *testing.T, metric *prometheus.CounterVec, val string) float64 { |
| 25 | var m = &dto.Metric{} |
nothing calls this directly
no test coverage detected