Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate usage of merge to MergeBuckets for static analysis #113155

Merged
merged 1 commit into from Oct 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
}