mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-20 19:56:36 +00:00
chore: enable more linter (#1557)
This commit is contained in:
@@ -60,7 +60,7 @@ type Collector struct {
|
||||
requestSecs *prometheus.Desc
|
||||
}
|
||||
|
||||
// All available collector functions
|
||||
// All available collector functions.
|
||||
var smbclientAllCollectorNames = []string{
|
||||
"ClientShares",
|
||||
}
|
||||
@@ -224,9 +224,7 @@ func (c *Collector) Build() error {
|
||||
}
|
||||
|
||||
if *c.smbClientCollectorsEnabled == "" {
|
||||
for _, collectorName := range smbclientAllCollectorNames {
|
||||
c.enabledCollectors = append(c.enabledCollectors, collectorName)
|
||||
}
|
||||
c.enabledCollectors = append(c.enabledCollectors, smbclientAllCollectorNames...)
|
||||
} else {
|
||||
for _, collectorName := range strings.Split(*c.smbClientCollectorsEnabled, ",") {
|
||||
if slices.Contains(smbclientAllCollectorNames, collectorName) {
|
||||
@@ -240,7 +238,7 @@ func (c *Collector) Build() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Collect collects smb client metrics and sends them to prometheus
|
||||
// Collect collects smb client metrics and sends them to prometheus.
|
||||
func (c *Collector) Collect(ctx *types.ScrapeContext, ch chan<- prometheus.Metric) error {
|
||||
collectorFuncs := map[string]func(ctx *types.ScrapeContext, ch chan<- prometheus.Metric) error{
|
||||
"ClientShares": c.collectClientShares,
|
||||
@@ -255,7 +253,7 @@ func (c *Collector) Collect(ctx *types.ScrapeContext, ch chan<- prometheus.Metri
|
||||
return nil
|
||||
}
|
||||
|
||||
// Perflib: SMB Client Shares
|
||||
// Perflib: SMB Client Shares.
|
||||
type perflibClientShares struct {
|
||||
Name string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user