mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-02 00:26:35 +00:00
feat(ci): add unused linter
Signed-off-by: Ben Reedy <breed808@breed808.com>
This commit is contained in:
@@ -87,7 +87,6 @@ linters:
|
|||||||
- testpackage
|
- testpackage
|
||||||
- thelper
|
- thelper
|
||||||
- tparallel
|
- tparallel
|
||||||
- unused
|
|
||||||
- usestdlibvars
|
- usestdlibvars
|
||||||
- varnamelen
|
- varnamelen
|
||||||
- wastedassign
|
- wastedassign
|
||||||
|
|||||||
@@ -285,7 +285,6 @@ func (c *collector) collectClientShares(ctx *types.ScrapeContext, ch chan<- prom
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for _, instance := range data {
|
for _, instance := range data {
|
||||||
// labelName := c.toLabelName(instance.Name)
|
|
||||||
if instance.Name == "_Total" {
|
if instance.Name == "_Total" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -446,10 +445,3 @@ func (c *collector) collectClientShares(ctx *types.ScrapeContext, ch chan<- prom
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// toLabelName converts strings to lowercase and replaces all whitespaces and dots with underscores
|
|
||||||
func (c *collector) toLabelName(name string) string {
|
|
||||||
s := strings.ReplaceAll(strings.Join(strings.Fields(strings.ToLower(name)), "_"), ".", "_")
|
|
||||||
s = strings.ReplaceAll(s, "__", "_")
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user