Skip to content

Commit a9841e6

Browse files
committed
db: re-observe L6 in metrics
Previously, our `total` line was overriding the output for L6 in our LSM & COMPACTION metrics. This patch ensures we move our cursor to a new line before writing out our total.
1 parent 4b9290a commit a9841e6

File tree

7 files changed

+114
-57
lines changed

7 files changed

+114
-57
lines changed

metrics.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,8 +855,8 @@ func (m *Metrics) String() string {
855855
}
856856
}
857857
cur = levelMetricsTable.Render(cur, table.RenderOptions{}, levelIter)
858+
cur = cur.NewlineReturn()
858859
cur.Offset(-1, 0).WriteString("total")
859-
//cur = cur.WriteString(levelMetricsTableBottomDivider).NewlineReturn()
860860
cur = cur.NewlineReturn()
861861

862862
// Compaction level metrics.
@@ -869,6 +869,7 @@ func (m *Metrics) String() string {
869869
}
870870
}
871871
cur = compactionLevelMetricsTable.Render(cur, table.RenderOptions{}, compactionLevelIter)
872+
cur = cur.NewlineReturn()
872873
cur.Offset(-1, 0).WriteString("total")
873874

874875
cur = cur.NewlineReturn()

testdata/compaction/l0_to_lbase_compaction

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ level size | tables size | count size | refsz valblk | in | tables
4242
3 0B | 0 0B | 0 0 | 0B 0B | 0B | 0 0B | 0 0
4343
4 0B | 0 0B | 0 0 | 0B 0B | 0B | 0 0B | 0 0
4444
5 0B | 0 0B | 0 0 | 0B 0B | 0B | 0 0B | 0 0
45-
total 6MB | 3 6MB | 0 0 | 0B 0B | 0B | 0 0B | 1 0
45+
6 6MB | 3 6MB | 0 0 | 0B 0B | 0B | 0 0B | 1 0
46+
total
4647

4748
COMPACTIONS | moved | multilevel | read | written
4849
level | score ff cff | tables size | top in read | tables blob | tables sstsz blobsz
@@ -53,7 +54,8 @@ level | score ff cff | tables size | top in read | tables blob | ta
5354
3 | 0 0 0 | 0 0B | 0B 0B 0B | 0B 0B | 0 0B 0B
5455
4 | 0 0 0 | 0 0B | 0B 0B 0B | 0B 0B | 0 0B 0B
5556
5 | 0 0 0 | 0 0B | 0B 0B 0B | 0B 0B | 0 0B 0B
56-
total | 0 0.09 0.09 | 3 6MB | 0B 0B 0B | 0B 0B | 0 0B 0B
57+
6 | 0 0.09 0.09 | 3 6MB | 0B 0B 0B | 0B 0B | 0 0B 0B
58+
total
5759

5860
kind | default delete elision move read tomb rewrite copy multi blob
5961
count | 0 0 0 3 0 0 0 0 0 0

testdata/compaction/value_separation

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ level size | tables size | count size | refsz valblk | in | tables
130130
3 0B | 0 0B | 0 0 | 0B 0B | 0B | 0 0B | 0 0
131131
4 0B | 0 0B | 0 0 | 0B 0B | 0B | 0 0B | 0 0
132132
5 0B | 0 0B | 0 0 | 0B 0B | 0B | 0 0B | 0 0
133-
total 1KB | 1 899B | 0 0 | 112B 0B | 848B | 0 0B | 1 1.19
133+
6 1KB | 1 899B | 0 0 | 112B 0B | 848B | 0 0B | 1 1.19
134+
total
134135

135136
COMPACTIONS | moved | multilevel | read | written
136137
level | score ff cff | tables size | top in read | tables blob | tables sstsz blobsz
@@ -141,7 +142,8 @@ level | score ff cff | tables size | top in read | tables blob | ta
141142
3 | 0 0 0 | 1 848B | 0B 0B 0B | 0B 0B | 0 0B 0B
142143
4 | 0 0 0 | 1 848B | 0B 0B 0B | 0B 0B | 0 0B 0B
143144
5 | 0 0 0 | 1 848B | 0B 0B 0B | 0B 0B | 0 0B 0B
144-
total | 0 0.00 0.00 | 0 0B | 0B 0B 0B | 372B 84B | 1 899B 112B
145+
6 | 0 0.00 0.00 | 0 0B | 0B 0B 0B | 372B 84B | 1 899B 112B
146+
total
145147

146148
kind | default delete elision move read tomb rewrite copy multi blob
147149
count | 1 0 0 5 0 0 0 0 0 0
@@ -402,7 +404,8 @@ level size | tables size | count size | refsz valblk | in | tables
402404
3 0B | 0 0B | 0 0 | 0B 0B | 0B | 0 0B | 0 0
403405
4 0B | 0 0B | 0 0 | 0B 0B | 0B | 0 0B | 0 0
404406
5 0B | 0 0B | 0 0 | 0B 0B | 0B | 0 0B | 0 0
405-
total 1.1KB | 1 900B | 0 0 | 232B 0B | 1.7KB | 0 0B | 1 0.51
407+
6 1.1KB | 1 900B | 0 0 | 232B 0B | 1.7KB | 0 0B | 1 0.51
408+
total
406409

407410
COMPACTIONS | moved | multilevel | read | written
408411
level | score ff cff | tables size | top in read | tables blob | tables sstsz blobsz
@@ -413,7 +416,8 @@ level | score ff cff | tables size | top in read | tables blob | ta
413416
3 | 0 0 0 | 0 0B | 0B 0B 0B | 0B 0B | 0 0B 0B
414417
4 | 0 0 0 | 0 0B | 0B 0B 0B | 0B 0B | 0 0B 0B
415418
5 | 0 0 0 | 0 0B | 0B 0B 0B | 0B 0B | 0 0B 0B
416-
total | 0 0.00 0.00 | 0 0B | 0B 0B 0B | 310B 0B | 1 900B 0B
419+
6 | 0 0.00 0.00 | 0 0B | 0B 0B 0B | 310B 0B | 1 900B 0B
420+
total
417421

418422
kind | default delete elision move read tomb rewrite copy multi blob
419423
count | 1 0 0 0 0 0 0 0 0 1

testdata/event_listener

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ level size | tables size | count size | refsz valblk | in | tables
252252
3 0B | 0 0B | 0 0 | 0B 0B | 0B | 0 0B | 0 0
253253
4 0B | 0 0B | 0 0 | 0B 0B | 0B | 0 0B | 0 0
254254
5 0B | 0 0B | 0 0 | 0B 0B | 0B | 0 0B | 0 0
255-
total 755B | 1 755B | 0 0 | 0B 0B | 1.5KB | 0 0B | 1 0.51
255+
6 755B | 1 755B | 0 0 | 0B 0B | 1.5KB | 0 0B | 1 0.51
256+
total
256257

257258
COMPACTIONS | moved | multilevel | read | written
258259
level | score ff cff | tables size | top in read | tables blob | tables sstsz blobsz
@@ -263,7 +264,8 @@ level | score ff cff | tables size | top in read | tables blob | ta
263264
3 | 0 0 0 | 0 0B | 0B 0B 0B | 0B 0B | 0 0B 0B
264265
4 | 0 0 0 | 0 0B | 0B 0B 0B | 0B 0B | 0 0B 0B
265266
5 | 0 0 0 | 0 0B | 0B 0B 0B | 0B 0B | 0 0B 0B
266-
total | 0 0.00 0.00 | 0 0B | 0B 0B 0B | 218B 0B | 1 755B 0B
267+
6 | 0 0.00 0.00 | 0 0B | 0B 0B 0B | 218B 0B | 1 755B 0B
268+
total
267269

268270
kind | default delete elision move read tomb rewrite copy multi blob
269271
count | 1 0 0 0 0 0 0 0 0 0
@@ -389,7 +391,8 @@ level size | tables size | count size | refsz valblk | in | tables
389391
3 0B | 0 0B | 0 0 | 0B 0B | 0B | 0 0B | 0 0
390392
4 0B | 0 0B | 0 0 | 0B 0B | 0B | 0 0B | 0 0
391393
5 0B | 0 0B | 0 0 | 0B 0B | 0B | 0 0B | 0 0
392-
total 1.5KB | 2 1.5KB | 0 0 | 0B 0B | 1.5KB | 1 755B | 1 0.51
394+
6 1.5KB | 2 1.5KB | 0 0 | 0B 0B | 1.5KB | 1 755B | 1 0.51
395+
total
393396

394397
COMPACTIONS | moved | multilevel | read | written
395398
level | score ff cff | tables size | top in read | tables blob | tables sstsz blobsz
@@ -400,7 +403,8 @@ level | score ff cff | tables size | top in read | tables blob | ta
400403
3 | 0 0 0 | 0 0B | 0B 0B 0B | 0B 0B | 0 0B 0B
401404
4 | 0 0 0 | 0 0B | 0B 0B 0B | 0B 0B | 0 0B 0B
402405
5 | 0 0 0 | 0 0B | 0B 0B 0B | 0B 0B | 0 0B 0B
403-
total | 0 0.00 0.00 | 0 0B | 0B 0B 0B | 218B 0B | 1 755B 0B
406+
6 | 0 0.00 0.00 | 0 0B | 0B 0B 0B | 218B 0B | 1 755B 0B
407+
total
404408

405409
kind | default delete elision move read tomb rewrite copy multi blob
406410
count | 1 0 0 0 0 0 0 0 0 0

testdata/ingest

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ level size | tables size | count size | refsz valblk | in | tables
4141
3 0B | 0 0B | 0 0 | 0B 0B | 0B | 0 0B | 0 0
4242
4 0B | 0 0B | 0 0 | 0B 0B | 0B | 0 0B | 0 0
4343
5 0B | 0 0B | 0 0 | 0B 0B | 0B | 0 0B | 0 0
44-
total 569B | 1 569B | 0 0 | 0B 0B | 0B | 1 569B | 1 0
44+
6 569B | 1 569B | 0 0 | 0B 0B | 0B | 1 569B | 1 0
45+
total
4546

4647
COMPACTIONS | moved | multilevel | read | written
4748
level | score ff cff | tables size | top in read | tables blob | tables sstsz blobsz
@@ -52,7 +53,8 @@ level | score ff cff | tables size | top in read | tables blob | ta
5253
3 | 0 0 0 | 0 0B | 0B 0B 0B | 0B 0B | 0 0B 0B
5354
4 | 0 0 0 | 0 0B | 0B 0B 0B | 0B 0B | 0 0B 0B
5455
5 | 0 0 0 | 0 0B | 0B 0B 0B | 0B 0B | 0 0B 0B
55-
total | 0 0.00 0.00 | 0 0B | 0B 0B 0B | 0B 0B | 0 0B 0B
56+
6 | 0 0.00 0.00 | 0 0B | 0B 0B 0B | 0B 0B | 0 0B 0B
57+
total
5658

5759
kind | default delete elision move read tomb rewrite copy multi blob
5860
count | 0 0 0 0 0 0 0 0 0 0

0 commit comments

Comments
 (0)