Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kvserver: add storage.sstable.zombie.bytes metric #122152

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/generated/metrics/metrics.html
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@
<tr><td>STORAGE</td><td>storage.shared-storage.write</td><td>Bytes written to external storage</td><td>Bytes</td><td>GAUGE</td><td>BYTES</td><td>AVG</td><td>NONE</td></tr>
<tr><td>STORAGE</td><td>storage.single-delete.ineffectual</td><td>Number of SingleDeletes that were ineffectual</td><td>Events</td><td>GAUGE</td><td>COUNT</td><td>AVG</td><td>NONE</td></tr>
<tr><td>STORAGE</td><td>storage.single-delete.invariant-violation</td><td>Number of SingleDelete invariant violations</td><td>Events</td><td>GAUGE</td><td>COUNT</td><td>AVG</td><td>NONE</td></tr>
<tr><td>STORAGE</td><td>storage.sstable.zombie.bytes</td><td>Bytes in SSTables that have been logically deleted, but can&#39;t yet be physically deleted because an open iterator may be reading them.</td><td>Bytes</td><td>GAUGE</td><td>BYTES</td><td>AVG</td><td>NONE</td></tr>
<tr><td>STORAGE</td><td>storage.wal.bytes_in</td><td>The number of logical bytes the storage engine has written to the WAL</td><td>Events</td><td>GAUGE</td><td>COUNT</td><td>AVG</td><td>NONE</td></tr>
<tr><td>STORAGE</td><td>storage.wal.bytes_written</td><td>The number of bytes the storage engine has written to the WAL</td><td>Events</td><td>GAUGE</td><td>COUNT</td><td>AVG</td><td>NONE</td></tr>
<tr><td>STORAGE</td><td>storage.wal.failover.primary.duration</td><td>Cumulative time spent writing to the primary WAL directory. Only populated when WAL failover is configured</td><td>Nanoseconds</td><td>GAUGE</td><td>NANOSECONDS</td><td>AVG</td><td>NONE</td></tr>
Expand Down
11 changes: 11 additions & 0 deletions pkg/kv/kvserver/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,14 @@ bytes preserved during flushes and compactions over the lifetime of the process.
Measurement: "Nanoseconds",
Unit: metric.Unit_NANOSECONDS,
}
metaSSTableZombieBytes = metric.Metadata{
Name: "storage.sstable.zombie.bytes",
Help: "Bytes in SSTables that have been logically deleted, " +
"but can't yet be physically deleted because an " +
"open iterator may be reading them.",
Measurement: "Bytes",
Unit: metric.Unit_BYTES,
}
)

var (
Expand Down Expand Up @@ -2590,6 +2598,7 @@ type StoreMetrics struct {
BatchCommitL0StallDuration *metric.Gauge
BatchCommitWALRotWaitDuration *metric.Gauge
BatchCommitCommitWaitDuration *metric.Gauge
SSTableZombieBytes *metric.Gauge
categoryIterMetrics pebbleCategoryIterMetricsContainer
categoryDiskWriteMetrics pebbleCategoryDiskWriteMetricsContainer
WALBytesWritten *metric.Gauge
Expand Down Expand Up @@ -3293,6 +3302,7 @@ func newStoreMetrics(histogramWindow time.Duration) *StoreMetrics {
BatchCommitL0StallDuration: metric.NewGauge(metaBatchCommitL0StallDuration),
BatchCommitWALRotWaitDuration: metric.NewGauge(metaBatchCommitWALRotDuration),
BatchCommitCommitWaitDuration: metric.NewGauge(metaBatchCommitCommitWaitDuration),
SSTableZombieBytes: metric.NewGauge(metaSSTableZombieBytes),
categoryIterMetrics: pebbleCategoryIterMetricsContainer{
registry: storeRegistry,
},
Expand Down Expand Up @@ -3723,6 +3733,7 @@ func (sm *StoreMetrics) updateEngineMetrics(m storage.Metrics) {
sm.BatchCommitL0StallDuration.Update(int64(m.BatchCommitStats.L0ReadAmpWriteStallDuration))
sm.BatchCommitWALRotWaitDuration.Update(int64(m.BatchCommitStats.WALRotationDuration))
sm.BatchCommitCommitWaitDuration.Update(int64(m.BatchCommitStats.CommitWaitDuration))
sm.SSTableZombieBytes.Update(int64(m.Table.ZombieSize))
sm.categoryIterMetrics.update(m.CategoryStats)
sm.categoryDiskWriteMetrics.update(m.DiskWriteStats)

Expand Down
Loading