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: export secondary cache counter metrics #110818

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

joshimhoff
Copy link
Collaborator

@joshimhoff joshimhoff commented Sep 18, 2023

Fixes #110899.

kvserver: export secondary cache counter metrics

This commits exports counter metrics regarding the secondary cache added at cockroachdb/pebble#2760. This commit doesn't export the histogram metrics added in that PR. While working on this one, I have realized a follow up PR is needed to export the bucketing scheme to CRDB.

Release note: None.

@joshimhoff joshimhoff requested review from RaduBerinde and a team September 18, 2023 14:55
@joshimhoff joshimhoff requested a review from a team as a code owner September 18, 2023 14:55
@blathers-crl
Copy link

blathers-crl bot commented Sep 18, 2023

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @itsbilal and @joshimhoff)


pkg/kv/kvserver/metrics.go line 772 at r1 (raw file):

	}
	metaSecondaryCacheSize = metric.Metadata{
		Name:        "storage.shared-storage.cache.size",

Let's name these storage.secondary-cache.*.


pkg/kv/kvserver/metrics.go line 773 at r1 (raw file):

	metaSecondaryCacheSize = metric.Metadata{
		Name:        "storage.shared-storage.cache.size",
		Help:        "The number of sstable bytes stored in the cache",

"in the secondary cache" (same below)

@joshimhoff joshimhoff force-pushed the add_sec_cache_counters branch from f39f2cd to a2a089e Compare September 19, 2023 14:28
Copy link
Collaborator Author

@joshimhoff joshimhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @itsbilal)


pkg/kv/kvserver/metrics.go line 772 at r1 (raw file):

Previously, RaduBerinde wrote…

Let's name these storage.secondary-cache.*.

Done!


pkg/kv/kvserver/metrics.go line 773 at r1 (raw file):

Previously, RaduBerinde wrote…

"in the secondary cache" (same below)

Done.

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Thanks!

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @itsbilal)

@joshimhoff
Copy link
Collaborator Author

joshimhoff commented Sep 19, 2023

TFTR!

@joshimhoff
Copy link
Collaborator Author

bors r+

@craig
Copy link
Contributor

craig bot commented Sep 19, 2023

Already running a review

@craig
Copy link
Contributor

craig bot commented Sep 19, 2023

Build failed (retrying...):

@yuzefovich
Copy link
Member

bors r-

This needs ./dev gen docs.

@craig
Copy link
Contributor

craig bot commented Sep 19, 2023

Canceled.

@nvanbenschoten
Copy link
Member

bors r-

This is failing CheckGeneratedCode/dev_generate. You'll need to run dev gen.

------- Stderr: -------
On branch staging
Your branch is up to date with 'origin/staging'.
You are in a sparse checkout with 100% of tracked files present.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
  modified:   docs/generated/metrics/metrics.html
no changes added to commit (use "git add" and/or "git commit -a")
diff --git a/docs/generated/metrics/metrics.html b/docs/generated/metrics/metrics.html
index 84e75fb6ca8..9ff027dc5f6 100644
--- a/docs/generated/metrics/metrics.html
+++ b/docs/generated/metrics/metrics.html
@@ -653,6 +653,16 @@
 <tr><td>STORAGE</td><td>storage.l6-level-size</td><td>Size of the SSTables in level 6</td><td>Bytes</td><td>GAUGE</td><td>BYTES</td><td>AVG</td><td>NONE</td></tr>
 <tr><td>STORAGE</td><td>storage.marked-for-compaction-files</td><td>Count of SSTables marked for compaction</td><td>SSTables</td><td>GAUGE</td><td>COUNT</td><td>AVG</td><td>NONE</td></tr>
 <tr><td>STORAGE</td><td>storage.queue.store-failures</td><td>Number of replicas which failed processing in replica queues due to retryable store errors</td><td>Replicas</td><td>COUNTER</td><td>COUNT</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
+<tr><td>STORAGE</td><td>storage.secondary-cache.count</td><td>The count of cache blocks in the secondary cache (not sstable blocks)</td><td>Cache items</td><td>GAUGE</td><td>COUNT</td><td>AVG</td><td>NONE</td></tr>
+<tr><td>STORAGE</td><td>storage.secondary-cache.evictions</td><td>The number of times a cache block was evicted from the secondary cache</td><td>Num evictions</td><td>GAUGE</td><td>COUNT</td><td>AVG</td><td>NONE</td></tr>
+<tr><td>STORAGE</td><td>storage.secondary-cache.reads-full-hit</td><td>The number of reads where all data returned was read from the secondary cache</td><td>Num reads</td><td>GAUGE</td><td>COUNT</td><td>AVG</td><td>NONE</td></tr>

@joshimhoff
Copy link
Collaborator Author

Thanks! Apologies.

This commits exports counter metrics regarding the secondary cache added at
cockroachdb/pebble#2760. This commit doesn't
export the histogram metrics added in that PR. While working on this one, I
have realized a follow up PR is needed to export the bucketing scheme to CRDB.

Release note: None.
@joshimhoff joshimhoff force-pushed the add_sec_cache_counters branch from a2a089e to b3a5247 Compare September 21, 2023 15:04
@joshimhoff
Copy link
Collaborator Author

bors r+

@craig
Copy link
Contributor

craig bot commented Sep 21, 2023

Build succeeded:

@craig craig bot merged commit e338a3d into cockroachdb:master Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export secondary cache metrics
5 participants