Skip to content

Commit

Permalink
Merge pull request #113155 from logicalhan/proxy-metric
Browse files Browse the repository at this point in the history
migrate usage of `merge` to `MergeBuckets` for static analysis
  • Loading branch information
k8s-ci-robot committed Oct 19, 2022
2 parents 4563668 + 958845e commit ad563cc
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions pkg/proxy/metrics/metrics.go
Expand Up @@ -61,7 +61,7 @@ var (
Subsystem: kubeProxySubsystem,
Name: "network_programming_duration_seconds",
Help: "In Cluster Network Programming Latency in seconds",
Buckets: merge(
Buckets: metrics.MergeBuckets(
metrics.LinearBuckets(0.25, 0.25, 2), // 0.25s, 0.50s
metrics.LinearBuckets(1, 1, 59), // 1s, 2s, 3s, ... 59s
metrics.LinearBuckets(60, 5, 12), // 60s, 65s, 70s, ... 115s
Expand Down Expand Up @@ -186,11 +186,3 @@ func RegisterMetrics() {
func SinceInSeconds(start time.Time) float64 {
return time.Since(start).Seconds()
}

func merge(slices ...[]float64) []float64 {
result := make([]float64, 1)
for _, s := range slices {
result = append(result, s...)
}
return result
}

0 comments on commit ad563cc

Please sign in to comment.