[#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

@ -1,7 +1,7 @@
package metrics
import (
"fmt"
"strconv"
"time"
"git.frostfs.info/TrueCloudLab/frostfs-observability/metrics"
@ -50,18 +50,18 @@ func newTreeServiceMetrics() *treeServiceMetrics {
func (m *treeServiceMetrics) AddReplicateTaskDuration(d time.Duration, success bool) {
m.replicateTaskDuration.With(prometheus.Labels{
treeServiceLabelSuccess: fmt.Sprintf("%v", success),
treeServiceLabelSuccess: strconv.FormatBool(success),
}).Observe(d.Seconds())
}
func (m *treeServiceMetrics) AddReplicateWaitDuration(d time.Duration, success bool) {
m.replicateWaitDuration.With(prometheus.Labels{
treeServiceLabelSuccess: fmt.Sprintf("%v", success),
treeServiceLabelSuccess: strconv.FormatBool(success),
}).Observe(d.Seconds())
}
func (m *treeServiceMetrics) AddSyncDuration(d time.Duration, success bool) {
m.syncOpDuration.With(prometheus.Labels{
treeServiceLabelSuccess: fmt.Sprintf("%v", success),
treeServiceLabelSuccess: strconv.FormatBool(success),
}).Observe(d.Seconds())
}