update: rename `updates` collector to `update` (#1692)

This commit is contained in:
Jan-Otto Kröpke 2024-10-15 13:55:16 +02:00 committed by GitHub
parent 73755b8bfe
commit 332b0a8a1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 12 additions and 12 deletions

View File

@ -1,6 +1,6 @@
//go:build windows //go:build windows
package updates package update
import ( import (
"errors" "errors"
@ -20,7 +20,7 @@ import (
"github.com/yusufpapurcu/wmi" "github.com/yusufpapurcu/wmi"
) )
const Name = "updates" const Name = "update"
type Config struct { type Config struct {
online bool `yaml:"online"` online bool `yaml:"online"`

View File

@ -1,12 +1,12 @@
package updates_test package update_test
import ( import (
"testing" "testing"
"github.com/prometheus-community/windows_exporter/internal/collector/updates" "github.com/prometheus-community/windows_exporter/internal/collector/update"
"github.com/prometheus-community/windows_exporter/internal/testutils" "github.com/prometheus-community/windows_exporter/internal/testutils"
) )
func BenchmarkCollector(b *testing.B) { func BenchmarkCollector(b *testing.B) {
testutils.FuncBenchmarkCollector(b, "printer", updates.NewWithFlags) testutils.FuncBenchmarkCollector(b, "printer", update.NewWithFlags)
} }

View File

@ -55,7 +55,7 @@ import (
"github.com/prometheus-community/windows_exporter/internal/collector/textfile" "github.com/prometheus-community/windows_exporter/internal/collector/textfile"
"github.com/prometheus-community/windows_exporter/internal/collector/thermalzone" "github.com/prometheus-community/windows_exporter/internal/collector/thermalzone"
"github.com/prometheus-community/windows_exporter/internal/collector/time" "github.com/prometheus-community/windows_exporter/internal/collector/time"
"github.com/prometheus-community/windows_exporter/internal/collector/updates" "github.com/prometheus-community/windows_exporter/internal/collector/update"
"github.com/prometheus-community/windows_exporter/internal/collector/vmware" "github.com/prometheus-community/windows_exporter/internal/collector/vmware"
v1 "github.com/prometheus-community/windows_exporter/internal/perfdata/v1" v1 "github.com/prometheus-community/windows_exporter/internal/perfdata/v1"
"github.com/prometheus-community/windows_exporter/internal/types" "github.com/prometheus-community/windows_exporter/internal/types"
@ -122,7 +122,7 @@ func NewWithConfig(config Config) *MetricCollectors {
collectors[textfile.Name] = textfile.New(&config.Textfile) collectors[textfile.Name] = textfile.New(&config.Textfile)
collectors[thermalzone.Name] = thermalzone.New(&config.ThermalZone) collectors[thermalzone.Name] = thermalzone.New(&config.ThermalZone)
collectors[time.Name] = time.New(&config.Time) collectors[time.Name] = time.New(&config.Time)
collectors[updates.Name] = updates.New(&config.Updates) collectors[update.Name] = update.New(&config.Update)
collectors[vmware.Name] = vmware.New(&config.Vmware) collectors[vmware.Name] = vmware.New(&config.Vmware)
return New(collectors) return New(collectors)

View File

@ -45,7 +45,7 @@ import (
"github.com/prometheus-community/windows_exporter/internal/collector/textfile" "github.com/prometheus-community/windows_exporter/internal/collector/textfile"
"github.com/prometheus-community/windows_exporter/internal/collector/thermalzone" "github.com/prometheus-community/windows_exporter/internal/collector/thermalzone"
"github.com/prometheus-community/windows_exporter/internal/collector/time" "github.com/prometheus-community/windows_exporter/internal/collector/time"
"github.com/prometheus-community/windows_exporter/internal/collector/updates" "github.com/prometheus-community/windows_exporter/internal/collector/update"
"github.com/prometheus-community/windows_exporter/internal/collector/vmware" "github.com/prometheus-community/windows_exporter/internal/collector/vmware"
) )
@ -94,7 +94,7 @@ type Config struct {
Textfile textfile.Config `yaml:"textfile"` Textfile textfile.Config `yaml:"textfile"`
ThermalZone thermalzone.Config `yaml:"thermal_zone"` ThermalZone thermalzone.Config `yaml:"thermal_zone"`
Time time.Config `yaml:"time"` Time time.Config `yaml:"time"`
Updates updates.Config `yaml:"updates"` Update update.Config `yaml:"update"`
Vmware vmware.Config `yaml:"vmware"` Vmware vmware.Config `yaml:"vmware"`
} }
@ -146,6 +146,6 @@ var ConfigDefaults = Config{
Textfile: textfile.ConfigDefaults, Textfile: textfile.ConfigDefaults,
ThermalZone: thermalzone.ConfigDefaults, ThermalZone: thermalzone.ConfigDefaults,
Time: time.ConfigDefaults, Time: time.ConfigDefaults,
Updates: updates.ConfigDefaults, Update: update.ConfigDefaults,
Vmware: vmware.ConfigDefaults, Vmware: vmware.ConfigDefaults,
} }

View File

@ -49,7 +49,7 @@ import (
"github.com/prometheus-community/windows_exporter/internal/collector/textfile" "github.com/prometheus-community/windows_exporter/internal/collector/textfile"
"github.com/prometheus-community/windows_exporter/internal/collector/thermalzone" "github.com/prometheus-community/windows_exporter/internal/collector/thermalzone"
"github.com/prometheus-community/windows_exporter/internal/collector/time" "github.com/prometheus-community/windows_exporter/internal/collector/time"
"github.com/prometheus-community/windows_exporter/internal/collector/updates" "github.com/prometheus-community/windows_exporter/internal/collector/update"
"github.com/prometheus-community/windows_exporter/internal/collector/vmware" "github.com/prometheus-community/windows_exporter/internal/collector/vmware"
) )
@ -104,7 +104,7 @@ var BuildersWithFlags = map[string]BuilderWithFlags[Collector]{
textfile.Name: NewBuilderWithFlags(textfile.NewWithFlags), textfile.Name: NewBuilderWithFlags(textfile.NewWithFlags),
thermalzone.Name: NewBuilderWithFlags(thermalzone.NewWithFlags), thermalzone.Name: NewBuilderWithFlags(thermalzone.NewWithFlags),
time.Name: NewBuilderWithFlags(time.NewWithFlags), time.Name: NewBuilderWithFlags(time.NewWithFlags),
updates.Name: NewBuilderWithFlags(updates.NewWithFlags), update.Name: NewBuilderWithFlags(update.NewWithFlags),
vmware.Name: NewBuilderWithFlags(vmware.NewWithFlags), vmware.Name: NewBuilderWithFlags(vmware.NewWithFlags),
} }