mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #114201 from Octopusjust/k8s-pr20
change unnecessary `switch` to `if` in metrics.go
This commit is contained in:
commit
9269aaada2
@ -114,8 +114,7 @@ func RegisterMetrics() {
|
|||||||
func RecordTransformation(transformationType, transformerPrefix string, elapsed time.Duration, err error) {
|
func RecordTransformation(transformationType, transformerPrefix string, elapsed time.Duration, err error) {
|
||||||
transformerOperationsTotal.WithLabelValues(transformationType, transformerPrefix, status.Code(err).String()).Inc()
|
transformerOperationsTotal.WithLabelValues(transformationType, transformerPrefix, status.Code(err).String()).Inc()
|
||||||
|
|
||||||
switch {
|
if err == nil {
|
||||||
case err == nil:
|
|
||||||
transformerLatencies.WithLabelValues(transformationType, transformerPrefix).Observe(elapsed.Seconds())
|
transformerLatencies.WithLabelValues(transformationType, transformerPrefix).Observe(elapsed.Seconds())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user