@@ -348,6 +348,8 @@ type Metrics struct {
348
348
BackingTableCount uint64
349
349
// The sum of the sizes of the BackingTableCount sstables that are backing virtual tables.
350
350
BackingTableSize uint64
351
+ // Compression statistics for sstable data (does not include blob files).
352
+ Compression CompressionMetrics
351
353
352
354
// Local file sizes.
353
355
Local struct {
@@ -437,9 +439,9 @@ type Metrics struct {
437
439
// ZombieCount is the number of local zombie blob files.
438
440
ZombieCount uint64
439
441
}
440
- }
441
442
442
- Compression CompressionMetrics
443
+ // TODO(radu): add compression stats.
444
+ }
443
445
444
446
FileCache FileCacheMetrics
445
447
@@ -489,15 +491,16 @@ type Metrics struct {
489
491
manualMemory manual.Metrics
490
492
}
491
493
492
- // CompressionMetrics contains compression metrics for sstables and blob files.
494
+ // CompressionMetrics contains compression metrics for sstables or blob files.
493
495
type CompressionMetrics struct {
494
496
// NoCompressionBytes is the total number of bytes in files that do are not
495
497
// compressed. Data can be uncompressed when 1) compression is disabled; 2)
496
498
// for certain special types of blocks; and 3) for blocks that are not
497
499
// compressible.
498
500
NoCompressionBytes uint64
499
- // CompressedBytesWithoutStats is the total number of bytes in files that do not
500
- // encode compression statistics (or for which there are no statistics yet).
501
+ // CompressedBytesWithoutStats is the total number of bytes in files that do
502
+ // not encode compression statistics (or for which there are no statistics
503
+ // yet).
501
504
CompressedBytesWithoutStats uint64
502
505
Snappy CompressionStatsForSetting
503
506
MinLZ CompressionStatsForSetting
@@ -1016,13 +1019,13 @@ func (m *Metrics) String() string {
1016
1019
cur = cur .WriteString (compressionTableHeader ).NewlineReturn ()
1017
1020
compressionContents := []pair [string , CompressionStatsForSetting ]{
1018
1021
{k : "none" , v : CompressionStatsForSetting {
1019
- CompressedBytes : m .Compression .NoCompressionBytes ,
1020
- UncompressedBytes : m .Compression .NoCompressionBytes ,
1022
+ CompressedBytes : m .Table . Compression .NoCompressionBytes ,
1023
+ UncompressedBytes : m .Table . Compression .NoCompressionBytes ,
1021
1024
}},
1022
- {k : "snappy" , v : m .Compression .Snappy },
1023
- {k : "minlz" , v : m .Compression .MinLZ },
1024
- {k : "zstd" , v : m .Compression .Zstd },
1025
- {k : "unknown" , v : CompressionStatsForSetting {CompressedBytes : m .Compression .CompressedBytesWithoutStats }},
1025
+ {k : "snappy" , v : m .Table . Compression .Snappy },
1026
+ {k : "minlz" , v : m .Table . Compression .MinLZ },
1027
+ {k : "zstd" , v : m .Table . Compression .Zstd },
1028
+ {k : "unknown" , v : CompressionStatsForSetting {CompressedBytes : m .Table . Compression .CompressedBytesWithoutStats }},
1026
1029
}
1027
1030
compressionContents = slices .DeleteFunc (compressionContents , func (p pair [string , CompressionStatsForSetting ]) bool {
1028
1031
return p .v .CompressedBytes == 0
0 commit comments