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

Add lock wait time metrics for Memory Cache. #2779

Merged
merged 1 commit into from
Sep 27, 2024
Merged

Conversation

mar-cf
Copy link
Collaborator

@mar-cf mar-cf commented Sep 24, 2024

No description provided.

@mar-cf mar-cf requested a review from mikea September 24, 2024 07:01
@mar-cf mar-cf marked this pull request as ready for review September 24, 2024 15:14
@mar-cf mar-cf requested review from a team as code owners September 24, 2024 15:14
@mar-cf mar-cf requested review from garrettgu10 and removed request for garrettgu10 September 24, 2024 15:14
src/workerd/api/memory-cache.c++ Outdated Show resolved Hide resolved
src/workerd/api/memory-cache.c++ Outdated Show resolved Hide resolved
src/workerd/io/observer.h Outdated Show resolved Hide resolved
src/workerd/io/observer.h Outdated Show resolved Hide resolved
src/workerd/io/observer.h Outdated Show resolved Hide resolved
src/workerd/io/observer.h Outdated Show resolved Hide resolved
src/workerd/io/observer.h Outdated Show resolved Hide resolved
src/workerd/api/memory-cache.h Outdated Show resolved Hide resolved
const kj::String& key, SpanBuilder& span) const {
kj::Locked<ThreadUnsafeData> data = [&] {
auto memoryCacheLockRecord =
ScopedDurationTagger(span, "memory_cache_lock_wait_time_ns"_kjc, cache->timer);
Copy link
Collaborator

Choose a reason for hiding this comment

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

since this is used twice lets extract single constexpr memoryCachekLockWaitTimeTag = ...

Use timer directly in memory cache lock record and write tag directly to span.
@mar-cf mar-cf merged commit 297ce16 into main Sep 27, 2024
14 checks passed
@mar-cf mar-cf deleted the mar/memory-cache-lwt branch September 27, 2024 00:25
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.

2 participants