mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-28 23:56:36 +00:00
chore(deps): update dependency golangci/golangci-lint to v2.2.1 (#2110)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
@@ -217,6 +217,7 @@ func (c *Collector) convertMetricFamily(logger *slog.Logger, metricFamily *dto.M
|
||||
for _, q := range metric.GetSummary().GetQuantile() {
|
||||
quantiles[q.GetQuantile()] = q.GetValue()
|
||||
}
|
||||
|
||||
ch <- prometheus.MustNewConstSummary(
|
||||
prometheus.NewDesc(
|
||||
metricFamily.GetName(),
|
||||
@@ -232,6 +233,7 @@ func (c *Collector) convertMetricFamily(logger *slog.Logger, metricFamily *dto.M
|
||||
for _, b := range metric.GetHistogram().GetBucket() {
|
||||
buckets[b.GetUpperBound()] = b.GetCumulativeCount()
|
||||
}
|
||||
|
||||
ch <- prometheus.MustNewConstHistogram(
|
||||
prometheus.NewDesc(
|
||||
metricFamily.GetName(),
|
||||
@@ -290,8 +292,8 @@ type carriageReturnFilteringReader struct {
|
||||
// Read returns data from the underlying io.Reader, but with \r filtered out.
|
||||
func (cr carriageReturnFilteringReader) Read(p []byte) (int, error) {
|
||||
buf := make([]byte, len(p))
|
||||
n, err := cr.r.Read(buf)
|
||||
|
||||
n, err := cr.r.Read(buf)
|
||||
if err != nil && err != io.EOF {
|
||||
return n, err
|
||||
}
|
||||
@@ -356,7 +358,6 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
|
||||
|
||||
return nil
|
||||
})
|
||||
|
||||
if err != nil && directory != "" {
|
||||
errs = append(errs, fmt.Errorf("error reading textfile directory %q: %w", directory, err))
|
||||
}
|
||||
|
||||
@@ -119,6 +119,7 @@ func TestDuplicateMetricEntry(t *testing.T) {
|
||||
}
|
||||
|
||||
var duplicateFamily []*dto.MetricFamily
|
||||
|
||||
duplicateFamily = append(duplicateFamily, &duplicate)
|
||||
|
||||
// Ensure detection for duplicate metrics
|
||||
|
||||
@@ -51,6 +51,7 @@ func TestMultipleDirectories(t *testing.T) {
|
||||
got := ""
|
||||
|
||||
errCh := make(chan error, 1)
|
||||
|
||||
go func() {
|
||||
errCh <- textFileCollector.Collect(metrics)
|
||||
|
||||
@@ -88,6 +89,7 @@ func TestDuplicateFileName(t *testing.T) {
|
||||
got := ""
|
||||
|
||||
errCh := make(chan error, 1)
|
||||
|
||||
go func() {
|
||||
errCh <- textFileCollector.Collect(metrics)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user