mirror of
https://github.com/zalando-incubator/kube-metrics-adapter.git
synced 2024-12-22 11:06:04 +00:00
Update golangci-lint config
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
This commit is contained in:
parent
54e2d2d564
commit
0f359920af
@ -4,7 +4,6 @@ run:
|
|||||||
linters:
|
linters:
|
||||||
disable-all: true
|
disable-all: true
|
||||||
enable:
|
enable:
|
||||||
- deadcode
|
|
||||||
- errcheck
|
- errcheck
|
||||||
- gosimple
|
- gosimple
|
||||||
- govet
|
- govet
|
||||||
@ -12,4 +11,3 @@ linters:
|
|||||||
- staticcheck
|
- staticcheck
|
||||||
- typecheck
|
- typecheck
|
||||||
- unused
|
- unused
|
||||||
- varcheck
|
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
ExternalRPSMetricType = "requests-per-second"
|
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 {
|
type ExternalRPSCollectorPlugin struct {
|
||||||
@ -86,13 +86,11 @@ func (p *ExternalRPSCollectorPlugin) NewCollector(
|
|||||||
weight = num / 100.0
|
weight = num / 100.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
confCopy.Config = map[string]string{
|
confCopy.Config = map[string]string{
|
||||||
"query": fmt.Sprintf(
|
"query": fmt.Sprintf(
|
||||||
ExternalRPSQuery,
|
ExternalRPSQuery,
|
||||||
p.metricName,
|
p.metricName,
|
||||||
strings.ReplaceAll(strings.Join(hostnames, "|"), ".", "_"),
|
strings.ReplaceAll(strings.Join(hostnames, "|"), ".", "_"),
|
||||||
weight,
|
weight,
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
@ -125,4 +123,3 @@ func (c *ExternalRPSCollector) GetMetrics() ([]CollectedMetric, error) {
|
|||||||
func (c *ExternalRPSCollector) Interval() time.Duration {
|
func (c *ExternalRPSCollector) Interval() time.Duration {
|
||||||
return c.interval
|
return c.interval
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user