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: preinitialize some Pebble category stats #133508

Merged
merged 1 commit into from
Oct 26, 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
18 changes: 18 additions & 0 deletions docs/generated/metrics/metrics.html
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,24 @@
<tr><td>STORAGE</td><td>storage.iterator.block-load.bytes</td><td>Bytes loaded by storage engine iterators (possibly cached). See storage.AggregatedIteratorStats for details.</td><td>Bytes</td><td>COUNTER</td><td>BYTES</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.block-load.cached-bytes</td><td>Bytes loaded by storage engine iterators from the block cache. See storage.AggregatedIteratorStats for details.</td><td>Bytes</td><td>COUNTER</td><td>BYTES</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.block-load.read-duration</td><td>Cumulative time storage engine iterators spent loading blocks from durable storage. See storage.AggregatedIteratorStats for details.</td><td>Nanoseconds</td><td>COUNTER</td><td>NANOSECONDS</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.category-batch-eval.block-load.bytes</td><td>Bytes loaded by storage sstable iterators (possibly cached).</td><td>Bytes</td><td>COUNTER</td><td>BYTES</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.category-batch-eval.block-load.cached-bytes</td><td>Bytes loaded by storage sstable iterators from the block cache</td><td>Bytes</td><td>COUNTER</td><td>BYTES</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.category-batch-eval.block-load.latency-sum</td><td>Cumulative latency for loading bytes not in the block cache, by storage sstable iterators</td><td>Latency</td><td>COUNTER</td><td>NANOSECONDS</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.category-crdb-unknown.block-load.bytes</td><td>Bytes loaded by storage sstable iterators (possibly cached).</td><td>Bytes</td><td>COUNTER</td><td>BYTES</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.category-crdb-unknown.block-load.cached-bytes</td><td>Bytes loaded by storage sstable iterators from the block cache</td><td>Bytes</td><td>COUNTER</td><td>BYTES</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.category-crdb-unknown.block-load.latency-sum</td><td>Cumulative latency for loading bytes not in the block cache, by storage sstable iterators</td><td>Latency</td><td>COUNTER</td><td>NANOSECONDS</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.category-mvcc-gc.block-load.bytes</td><td>Bytes loaded by storage sstable iterators (possibly cached).</td><td>Bytes</td><td>COUNTER</td><td>BYTES</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.category-mvcc-gc.block-load.cached-bytes</td><td>Bytes loaded by storage sstable iterators from the block cache</td><td>Bytes</td><td>COUNTER</td><td>BYTES</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.category-mvcc-gc.block-load.latency-sum</td><td>Cumulative latency for loading bytes not in the block cache, by storage sstable iterators</td><td>Latency</td><td>COUNTER</td><td>NANOSECONDS</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.category-rangefeed.block-load.bytes</td><td>Bytes loaded by storage sstable iterators (possibly cached).</td><td>Bytes</td><td>COUNTER</td><td>BYTES</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.category-rangefeed.block-load.cached-bytes</td><td>Bytes loaded by storage sstable iterators from the block cache</td><td>Bytes</td><td>COUNTER</td><td>BYTES</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.category-rangefeed.block-load.latency-sum</td><td>Cumulative latency for loading bytes not in the block cache, by storage sstable iterators</td><td>Latency</td><td>COUNTER</td><td>NANOSECONDS</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.category-replication.block-load.bytes</td><td>Bytes loaded by storage sstable iterators (possibly cached).</td><td>Bytes</td><td>COUNTER</td><td>BYTES</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.category-replication.block-load.cached-bytes</td><td>Bytes loaded by storage sstable iterators from the block cache</td><td>Bytes</td><td>COUNTER</td><td>BYTES</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.category-replication.block-load.latency-sum</td><td>Cumulative latency for loading bytes not in the block cache, by storage sstable iterators</td><td>Latency</td><td>COUNTER</td><td>NANOSECONDS</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.category-scan-regular.block-load.bytes</td><td>Bytes loaded by storage sstable iterators (possibly cached).</td><td>Bytes</td><td>COUNTER</td><td>BYTES</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.category-scan-regular.block-load.cached-bytes</td><td>Bytes loaded by storage sstable iterators from the block cache</td><td>Bytes</td><td>COUNTER</td><td>BYTES</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.category-scan-regular.block-load.latency-sum</td><td>Cumulative latency for loading bytes not in the block cache, by storage sstable iterators</td><td>Latency</td><td>COUNTER</td><td>NANOSECONDS</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.external.seeks</td><td>Cumulative count of seeks performed on storage engine iterators. See storage.AggregatedIteratorStats for details.</td><td>Iterator Ops</td><td>COUNTER</td><td>COUNT</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.external.steps</td><td>Cumulative count of steps performed on storage engine iterators. See storage.AggregatedIteratorStats for details.</td><td>Iterator Ops</td><td>COUNTER</td><td>COUNT</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>STORAGE</td><td>storage.iterator.internal.seeks</td><td>Cumulative count of seeks performed internally within storage engine iterators.<br/><br/>A value high relative to &#39;storage.iterator.external.seeks&#39;<br/>is a good indication that there&#39;s an accumulation of garbage<br/>internally within the storage engine.<br/><br/>See storage.AggregatedIteratorStats for details.</td><td>Iterator Ops</td><td>COUNTER</td><td>COUNT</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</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 @@ -3753,6 +3753,17 @@ func newStoreMetrics(histogramWindow time.Duration) *StoreMetrics {

storeRegistry.AddMetricStruct(sm)
storeRegistry.AddMetricStruct(sm.LoadSplitterMetrics)

// Pre-initialize some category stats, so that metrics generation is
// deterministic.
// TODO(radu): #133507 tracks fixing this properly.
for _, category := range []sstable.Category{
"batch-eval", "crdb-unknown", "mvcc-gc", "rangefeed",
"replication", "scan-regular"} {
cm := makePebbleCategorizedIterMetrics(category)
sm.categoryIterMetrics.metricsMap.Store(category, cm)
storeRegistry.AddMetricStruct(cm)
}
return sm
}

Expand Down
Loading