@@ -197,6 +197,11 @@ type Metrics struct {
197197 // CancelledBytes the number of bytes written by compactions that were
198198 // cancelled.
199199 CancelledBytes int64
200+ // Total number of compactions that hit an error.
201+ FailedCount int64
202+ // NumProblemSpans is the current (instantaneous) count of "problem spans"
203+ // which temporarily block compactions.
204+ NumProblemSpans int
200205 // MarkedFiles is a count of files that are marked for
201206 // compaction. Such files are compacted in a rewrite compaction
202207 // when no other compactions are picked.
@@ -687,11 +692,16 @@ func (m *Metrics) SafeFormat(w redact.SafePrinter, _ rune) {
687692
688693 w .Printf ("Flushes: %d\n " , redact .Safe (m .Flush .Count ))
689694
690- w .Printf ("Compactions: %d estimated debt: %s in progress: %d (%s)\n " ,
695+ w .Printf ("Compactions: %d estimated debt: %s in progress: %d (%s) canceled: %d (%s) failed: %d problem spans: %d \n " ,
691696 redact .Safe (m .Compact .Count ),
692697 humanize .Bytes .Uint64 (m .Compact .EstimatedDebt ),
693698 redact .Safe (m .Compact .NumInProgress ),
694- humanize .Bytes .Int64 (m .Compact .InProgressBytes ))
699+ humanize .Bytes .Int64 (m .Compact .InProgressBytes ),
700+ redact .Safe (m .Compact .CancelledCount ),
701+ humanize .Bytes .Int64 (m .Compact .CancelledBytes ),
702+ redact .Safe (m .Compact .FailedCount ),
703+ redact .Safe (m .Compact .NumProblemSpans ),
704+ )
695705
696706 w .Printf (" default: %d delete: %d elision: %d move: %d read: %d tombstone-density: %d rewrite: %d copy: %d multi-level: %d\n " ,
697707 redact .Safe (m .Compact .DefaultCount ),
@@ -702,7 +712,8 @@ func (m *Metrics) SafeFormat(w redact.SafePrinter, _ rune) {
702712 redact .Safe (m .Compact .TombstoneDensityCount ),
703713 redact .Safe (m .Compact .RewriteCount ),
704714 redact .Safe (m .Compact .CopyCount ),
705- redact .Safe (m .Compact .MultiLevelCount ))
715+ redact .Safe (m .Compact .MultiLevelCount ),
716+ )
706717
707718 w .Printf ("MemTables: %d (%s) zombie: %d (%s)\n " ,
708719 redact .Safe (m .MemTable .Count ),
0 commit comments