mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-10 04:26:35 +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))
|
_ = level.Error(c.logger).Log("msg", fmt.Sprintf("Duplicate filename detected: %q. Skip File.", path))
|
||||||
errorMetric = 1.0
|
errorMetric = 1.0
|
||||||
return nil
|
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
|
return nil
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -177,7 +177,10 @@ func TestMultipleDirectories(t *testing.T) {
|
|||||||
for {
|
for {
|
||||||
var metric dto.Metric
|
var metric dto.Metric
|
||||||
val := <-metrics
|
val := <-metrics
|
||||||
val.Write(&metric)
|
err := val.Write(&metric)
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("Unexpected error %s", err)
|
||||||
|
}
|
||||||
got += metric.String()
|
got += metric.String()
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
@@ -208,7 +211,10 @@ func TestDuplicateFileName(t *testing.T) {
|
|||||||
for {
|
for {
|
||||||
var metric dto.Metric
|
var metric dto.Metric
|
||||||
val := <-metrics
|
val := <-metrics
|
||||||
val.Write(&metric)
|
err := val.Write(&metric)
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("Unexpected error %s", err)
|
||||||
|
}
|
||||||
got += metric.String()
|
got += metric.String()
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|||||||
Reference in New Issue
Block a user