Skip to content

Commit

Permalink
Merge pull request #577 from zalando-incubator/update-golangci-lint-cfg
Browse files Browse the repository at this point in the history
Update golangci-lint config
  • Loading branch information
mikkeloscar authored Jun 30, 2023
2 parents 54e2d2d + 0f35992 commit 542d90d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ run:
linters:
disable-all: true
enable:
- deadcode
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- unused
- varcheck
7 changes: 2 additions & 5 deletions pkg/collector/external_rps_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

const (
ExternalRPSMetricType = "requests-per-second"
ExternalRPSQuery = `scalar(sum(rate(%s{host=~"%s"}[1m])) * %.4f)`
ExternalRPSQuery = `scalar(sum(rate(%s{host=~"%s"}[1m])) * %.4f)`
)

type ExternalRPSCollectorPlugin struct {
Expand Down Expand Up @@ -85,14 +85,12 @@ func (p *ExternalRPSCollectorPlugin) NewCollector(
}
weight = num / 100.0
}



confCopy.Config = map[string]string{
"query": fmt.Sprintf(
ExternalRPSQuery,
p.metricName,
strings.ReplaceAll(strings.Join(hostnames, "|"), ".", "_"),
strings.ReplaceAll(strings.Join(hostnames, "|"), ".", "_"),
weight,
),
}
Expand Down Expand Up @@ -125,4 +123,3 @@ func (c *ExternalRPSCollector) GetMetrics() ([]CollectedMetric, error) {
func (c *ExternalRPSCollector) Interval() time.Duration {
return c.interval
}

0 comments on commit 542d90d

Please sign in to comment.