[#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"
"time"
"git.frostfs.info/TrueCloudLab/frostfs-observability/metrics"
@ -46,7 +47,7 @@ func newMorphCacheMetrics() *morphCacheMetrics {
func (m *morphCacheMetrics) AddNNSContractHashDuration(success bool, d time.Duration) {
m.nnsContractHashDuration.With(
prometheus.Labels{
mcSuccess: fmt.Sprintf("%v", success),
mcSuccess: strconv.FormatBool(success),
},
).Observe(float64(d))
}
@ -54,7 +55,7 @@ func (m *morphCacheMetrics) AddNNSContractHashDuration(success bool, d time.Dura
func (m *morphCacheMetrics) AddGroupKeyDuration(success bool, d time.Duration) {
m.groupKeyDuration.With(
prometheus.Labels{
mcSuccess: fmt.Sprintf("%v", success),
mcSuccess: strconv.FormatBool(success),
},
).Observe(float64(d))
}
@ -62,7 +63,7 @@ func (m *morphCacheMetrics) AddGroupKeyDuration(success bool, d time.Duration) {
func (m *morphCacheMetrics) AddTxHeightDuration(hash util.Uint256, success bool, d time.Duration) {
m.txHeightDuration.With(
prometheus.Labels{
mcSuccess: fmt.Sprintf("%v", success),
mcSuccess: strconv.FormatBool(success),
},
).Observe(float64(d))
}