From f883d61c28b9d1c4193b7c32aa635af8fb4524ec Mon Sep 17 00:00:00 2001 From: Alan Bernstein Date: Thu, 9 Apr 2020 17:20:17 -0500 Subject: [PATCH] Consolidate BlockRepair metrics with tags --- fragment.go | 4 ++-- metrics.go | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fragment.go b/fragment.go index 588ea77ae..e9a7eec7d 100644 --- a/fragment.go +++ b/fragment.go @@ -3044,13 +3044,13 @@ func (s *fragmentSyncer) syncFragment() error { if err := s.syncBlockFromPrimary(blockID); err != nil { return fmt.Errorf("sync block from primary: id=%d, err=%s", blockID, err) } - s.Fragment.stats.Count(MetricBlockRepairPrimary, 1, 1.0) + s.Fragment.stats.CountWithCustomTags(MetricBlockRepair, 1, 1.0, []string{"primary:true"}) default: // Synchronize block. if err := s.syncBlock(blockID); err != nil { return fmt.Errorf("sync block: id=%d, err=%s", blockID, err) } - s.Fragment.stats.Count(MetricBlockRepair, 1, 1.0) + s.Fragment.stats.CountWithCustomTags(MetricBlockRepair, 1, 1.0, []string{"primary:false"}) } } diff --git a/metrics.go b/metrics.go index fc451772f..93cb6b649 100644 --- a/metrics.go +++ b/metrics.go @@ -38,7 +38,6 @@ const ( MetricClearingN = "clearing_total" MetricClearedN = "cleared_total" MetricSnapshotDuration = "snapshot_duration_seconds" - MetricBlockRepairPrimary = "block_repair_primary_total" MetricBlockRepair = "block_repair_total" MetricSyncFieldDuration = "sync_field_duration_seconds" MetricSyncIndexDuration = "sync_index_duration_seconds"