Consolidate BlockRepair metrics with tags

This commit is contained in:
Alan Bernstein 2020-04-09 17:20:17 -05:00 committed by Matt Jaffee
parent 389acfc8ed
commit f883d61c28
No known key found for this signature in database
GPG key ID: 08A3DFFF987B11BF
2 changed files with 2 additions and 3 deletions

View file

@ -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"})
}
}

View file

@ -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"