Skip to content

Commit 43ef0c5

Browse files
Merge pull request #79 from DataDog/rgs/context-lookup-counters
counters for missing context
2 parents ccaa5c9 + d00f993 commit 43ef0c5

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

ddprof-lib/src/main/cpp/context.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ Context& Contexts::get(int tid) {
3535
if ((context.spanId ^ context.rootSpanId) == context.checksum) {
3636
return context;
3737
}
38+
Counters::increment(CounterId::CONTEXT_CHECKSUM_REJECT_GETS);
39+
} else {
40+
Counters::increment(CounterId::CONTEXT_NULL_PAGE_GETS);
3841
}
3942
} else {
4043
Counters::increment(CounterId::CONTEXT_BOUNDS_MISS_GETS);

ddprof-lib/src/main/cpp/counters.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
X(CONTEXT_STORAGE_PAGES, "context_storage_pages") \
4242
X(CONTEXT_BOUNDS_MISS_INITS, "context_bounds_miss_inits") \
4343
X(CONTEXT_BOUNDS_MISS_GETS, "context_bounds_miss_gets") \
44+
X(CONTEXT_CHECKSUM_REJECT_GETS, "context_checksum_reject_gets") \
45+
X(CONTEXT_NULL_PAGE_GETS, "context_null_page_gets") \
4446
X(CALLTRACE_STORAGE_BYTES, "calltrace_storage_bytes") \
4547
X(CALLTRACE_STORAGE_TRACES, "calltrace_storage_traces") \
4648
X(LINEAR_ALLOCATOR_BYTES, "linear_allocator_bytes") \

0 commit comments

Comments
 (0)