[#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"
@ -64,7 +64,7 @@ func newGCMetrics() *gcMetrics {
func (m *gcMetrics) AddRunDuration(shardID string, d time.Duration, success bool) {
m.runDuration.With(prometheus.Labels{
gcShardID: shardID,
gcSuccess: fmt.Sprintf("%v", success),
gcSuccess: strconv.FormatBool(success),
}).Add(d.Seconds())
}
@ -84,7 +84,7 @@ func (m *gcMetrics) AddDeletedCount(shardID string, deleted, failed uint64) {
func (m *gcMetrics) AddExpiredObjectCollectionDuration(shardID string, d time.Duration, success bool, objectType string) {
m.expCollectDuration.With(prometheus.Labels{
gcShardID: shardID,
gcSuccess: fmt.Sprintf("%v", success),
gcSuccess: strconv.FormatBool(success),
gcObjectType: objectType,
}).Add(d.Seconds())
}