mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-15 17:36:34 +00:00
@@ -294,10 +294,9 @@ func (c *textFileCollector) Collect(ctx *ScrapeContext, ch chan<- prometheus.Met
|
||||
_ = level.Error(c.logger).Log("msg", fmt.Sprintf("Duplicate filename detected: %q. Skip File.", path))
|
||||
errorMetric = 1.0
|
||||
return nil
|
||||
} else {
|
||||
mtimes[fileInfo.Name()] = fileInfo.ModTime()
|
||||
metricFamilies = append(metricFamilies, families_array...)
|
||||
}
|
||||
mtimes[fileInfo.Name()] = fileInfo.ModTime()
|
||||
metricFamilies = append(metricFamilies, families_array...)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
@@ -177,7 +177,10 @@ func TestMultipleDirectories(t *testing.T) {
|
||||
for {
|
||||
var metric dto.Metric
|
||||
val := <-metrics
|
||||
val.Write(&metric)
|
||||
err := val.Write(&metric)
|
||||
if err != nil {
|
||||
t.Errorf("Unexpected error %s", err)
|
||||
}
|
||||
got += metric.String()
|
||||
}
|
||||
}()
|
||||
@@ -208,7 +211,10 @@ func TestDuplicateFileName(t *testing.T) {
|
||||
for {
|
||||
var metric dto.Metric
|
||||
val := <-metrics
|
||||
val.Write(&metric)
|
||||
err := val.Write(&metric)
|
||||
if err != nil {
|
||||
t.Errorf("Unexpected error %s", err)
|
||||
}
|
||||
got += metric.String()
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user