*: Implement collector interface for registry perfdata (#1670)

This commit is contained in:
Jan-Otto Kröpke
2024-10-05 21:33:40 +02:00
committed by GitHub
parent 2a9a11bd01
commit 5952c51a39
53 changed files with 661 additions and 1267 deletions

View File

@@ -12,7 +12,7 @@ import (
"github.com/alecthomas/kingpin/v2"
"github.com/prometheus-community/windows_exporter/internal/headers/sysinfoapi"
"github.com/prometheus-community/windows_exporter/internal/perflib"
v1 "github.com/prometheus-community/windows_exporter/internal/perfdata/v1"
"github.com/prometheus-community/windows_exporter/internal/types"
"github.com/prometheus/client_golang/prometheus"
"github.com/yusufpapurcu/wmi"
@@ -418,7 +418,7 @@ func (c *Collector) collectPerformanceData(ctx *types.ScrapeContext, logger *slo
var dst []memory
if err := perflib.UnmarshalObject(ctx.PerfObjects["Memory"], &dst, logger); err != nil {
if err := v1.UnmarshalObject(ctx.PerfObjects["Memory"], &dst, logger); err != nil {
return err
}