chore: Remove registry based perfdata collector (#1742)

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2024-11-17 21:51:12 +01:00
committed by GitHub
parent 6206b695c6
commit e6a15d4ec4
213 changed files with 8079 additions and 12405 deletions

View File

@@ -105,7 +105,7 @@ func NewWithFlags(app *kingpin.Application) *Collector {
return c
}
func (c *Collector) Close(_ *slog.Logger) error {
func (c *Collector) Close() error {
return nil
}
@@ -153,10 +153,6 @@ func (c *Collector) Build(_ *slog.Logger, miSession *mi.Session) error {
func (c *Collector) GetName() string { return Name }
func (c *Collector) GetPerfCounter(_ *slog.Logger) ([]string, error) {
return []string{"Printer"}, nil
}
type wmiPrinter struct {
Name string `mi:"Name"`
Default bool `mi:"Default"`
@@ -169,7 +165,7 @@ type wmiPrintJob struct {
Status string `mi:"Status"`
}
func (c *Collector) Collect(_ *types.ScrapeContext, _ *slog.Logger, ch chan<- prometheus.Metric) error {
func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
var errs []error
if err := c.collectPrinterStatus(ch); err != nil {

View File

@@ -1,3 +1,5 @@
//go:build windows
package printer_test
import (
@@ -5,7 +7,7 @@ import (
"github.com/alecthomas/kingpin/v2"
"github.com/prometheus-community/windows_exporter/internal/collector/printer"
"github.com/prometheus-community/windows_exporter/internal/testutils"
"github.com/prometheus-community/windows_exporter/internal/utils/testutils"
)
func BenchmarkCollector(b *testing.B) {