@@ -215,6 +215,12 @@ type Metrics struct {
215215 MultiLevelCount int64
216216 BlobFileRewriteCount int64
217217 VirtualRewriteCount int64
218+ // BlobFileRewriteBytesRead is the total number of bytes read during
219+ // blob file rewrite compactions.
220+ BlobFileRewriteBytesRead int64
221+ // BlobFileRewriteBytesWritten is the total number of bytes written during
222+ // blob file rewrite compactions.
223+ BlobFileRewriteBytesWritten int64
218224 // An estimate of the number of bytes that need to be compacted for the LSM
219225 // to reach a stable state.
220226 EstimatedDebt uint64
@@ -761,16 +767,21 @@ var (
761767 table .String ("tot" , 13 , table .AlignRight , func (i cgoMemInfo ) string { return i .memtablesTot }),
762768 )
763769 compactionInfoTableTopHeader = `COMPACTIONS`
770+ compactionInfoTableSubHeader = ` | blob rewrites`
764771 compactionInfoTable = table .Define [compactionMetricsInfo ](
765- table .String ("estimated debt" , 17 , table .AlignRight , func (i compactionMetricsInfo ) string { return i .estimatedDebt }),
772+ table .String ("est. debt" , 13 , table .AlignRight , func (i compactionMetricsInfo ) string { return i .estimatedDebt }),
766773 table .Div (),
767- table .String ("in progress" , 17 , table .AlignRight , func (i compactionMetricsInfo ) string { return i .inProgress }),
774+ table .String ("in progress" , 13 , table .AlignRight , func (i compactionMetricsInfo ) string { return i .inProgress }),
768775 table .Div (),
769- table .String ("cancelled" , 17 , table .AlignRight , func (i compactionMetricsInfo ) string { return i .cancelled }),
776+ table .String ("cancelled" , 10 , table .AlignRight , func (i compactionMetricsInfo ) string { return i .cancelled }),
770777 table .Div (),
771- table .String ("failed" , 17 , table .AlignRight , func (i compactionMetricsInfo ) string { return fmt .Sprint (i .failed ) }),
778+ table .String ("failed" , 8 , table .AlignRight , func (i compactionMetricsInfo ) string { return fmt .Sprint (i .failed ) }),
772779 table .Div (),
773- table .String ("problem spans" , 18 , table .AlignRight , func (i compactionMetricsInfo ) string { return i .problemSpans }),
780+ table .String ("problem spans" , 16 , table .AlignRight , func (i compactionMetricsInfo ) string { return i .problemSpans }),
781+ table .Div (),
782+ table .String ("read" , 10 , table .AlignRight , func (i compactionMetricsInfo ) string { return i .blobFileRewriteBytesRead }),
783+ table .Div (),
784+ table .String ("written" , 10 , table .AlignRight , func (i compactionMetricsInfo ) string { return i .blobFileRewriteBytesWritten }),
774785 )
775786 keysInfoTableTopHeader = `KEYS`
776787 keysInfoTable = table .Define [keysInfo ](
@@ -885,11 +896,13 @@ type cgoMemInfo struct {
885896}
886897
887898type compactionMetricsInfo struct {
888- estimatedDebt string
889- inProgress string
890- cancelled string
891- failed int64
892- problemSpans string
899+ estimatedDebt string
900+ inProgress string
901+ cancelled string
902+ failed int64
903+ problemSpans string
904+ blobFileRewriteBytesRead string
905+ blobFileRewriteBytesWritten string
893906}
894907
895908type keysInfo struct {
@@ -1074,10 +1087,13 @@ func (m *Metrics) String() string {
10741087 humanizeBytes (m .Compact .InProgressBytes )),
10751088 cancelled : fmt .Sprintf ("%s (%s)" , humanizeCount (m .Compact .CancelledCount ),
10761089 humanizeBytes (m .Compact .CancelledBytes )),
1077- failed : m .Compact .FailedCount ,
1078- problemSpans : fmt .Sprintf ("%d%s" , m .Compact .NumProblemSpans , ifNonZero (m .Compact .NumProblemSpans , "!!" )),
1090+ failed : m .Compact .FailedCount ,
1091+ problemSpans : fmt .Sprintf ("%d%s" , m .Compact .NumProblemSpans , ifNonZero (m .Compact .NumProblemSpans , "!!" )),
1092+ blobFileRewriteBytesRead : humanizeBytes (m .Compact .BlobFileRewriteBytesRead ),
1093+ blobFileRewriteBytesWritten : humanizeBytes (m .Compact .BlobFileRewriteBytesWritten ),
10791094 }
10801095 cur = cur .WriteString (compactionInfoTableTopHeader ).NewlineReturn ()
1096+ cur = cur .WriteString (compactionInfoTableSubHeader ).NewlineReturn ()
10811097 cur = compactionInfoTable .Render (cur , table.RenderOptions {}, compactionMetricsInfoContents )
10821098 cur = cur .NewlineReturn ()
10831099
0 commit comments