Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
wildum committed Nov 8, 2024
1 parent afc96aa commit 3c93929
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,21 @@ func TestWindowsMetrics(t *testing.T) {
}

done := make(chan bool)

srv := &http.Server{Addr: ":9090"}

http.HandleFunc("/receive", func(w http.ResponseWriter, r *http.Request) {
ts, _ := handlePost(t, w, r)

// Check each received time series for required metrics
for _, timeseries := range ts {
var metricName string
for _, label := range timeseries.Labels {
metricName := label.Name
if label.Name == "__name__" {
metricName = label.Value
break
}

for _, requiredMetric := range winMetrics {
if requiredMetric == metricName && !foundMetrics[requiredMetric] {
foundMetrics[requiredMetric] = true
}
}
for _, requiredMetric := range winMetrics {
if requiredMetric == metricName && !foundMetrics[requiredMetric] {
foundMetrics[requiredMetric] = true
}
}
}
Expand Down

0 comments on commit 3c93929

Please sign in to comment.