-
Notifications
You must be signed in to change notification settings - Fork 867
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 span names cache #4004
Add span names cache #4004
Conversation
import java.lang.reflect.Method; | ||
import org.checkerframework.checker.nullness.qual.Nullable; | ||
|
||
public final class SpanNames { | ||
|
||
private static final ClassValue<Cache<String, String>> spanNameCaches = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check whether instrumentation have their own cache to not double cache?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, just looked through all callers, didn't find any secondary caches
new ClassValue<Cache<String, String>>() { | ||
@Override | ||
protected Cache<String, String> computeValue(Class<?> clazz) { | ||
// should be naturally bounded, but setting a limit just in case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems pretty safe to me I'd probably just use ConcurrentHashMap. I think I've seen us using it in other similar caches
No description provided.