[#442] Use strconv.FormatBool instead of untyped conversion

Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
This commit is contained in:
Alejandro Lopez 2023-06-13 14:19:33 +03:00 committed by Evgenii Stratonikov
parent 344d6b2ae1
commit fb8fee0c8e
4 changed files with 14 additions and 12 deletions

View file

@ -2,6 +2,7 @@ package metrics
import (
"fmt"
"strconv"
"sync"
"time"
@ -148,7 +149,7 @@ func (m *writeCacheMetrics) SetMode(shardID string, mode string) {
func (m *writeCacheMetrics) IncFlushCounter(shardID string, success bool, storageType string) {
m.flushCounter.With(prometheus.Labels{
wcShardID: shardID,
wcSuccess: fmt.Sprintf("%v", success),
wcSuccess: strconv.FormatBool(success),
wcStorage: storageType,
}).Inc()
}
@ -164,7 +165,7 @@ func setWriteCacheDuration(m *prometheus.HistogramVec, shardID string, success b
m.With(
prometheus.Labels{
wcShardID: shardID,
wcSuccess: fmt.Sprintf("%v", success),
wcSuccess: strconv.FormatBool(success),
wcStorage: storageType,
},
).Observe(d.Seconds())