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

Remove LongAdder and ClassValue usages from instrumentation-api #4671

Merged

Conversation

mateuszrzeszutek
Copy link
Member

Resolves #4533

private final LongAdder internal = new LongAdder();
private final LongAdder consumer = new LongAdder();
private final LongAdder producer = new LongAdder();
private final AtomicLong server = new AtomicLong();
Copy link
Contributor

Choose a reason for hiding this comment

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

I think LongAdder is important in normal code. We should have a wrapper around the two types based on classpath check, and can use @IgnoreJreRequirement to allow LongAdder

Copy link
Member

Choose a reason for hiding this comment

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

AtomicLong counters seem acceptable here since they are only used when agent debug is enabled. Not sure whether we'll need our own high-throughput counters in instrumentation, since typically that kind of work will be delegated to the Metrics API.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah thanks for pointing that out - agree if only when debug is enabled, AtomicLong is fine

private final LongAdder internal = new LongAdder();
private final LongAdder consumer = new LongAdder();
private final LongAdder producer = new LongAdder();
private final AtomicLong server = new AtomicLong();
Copy link
Member

Choose a reason for hiding this comment

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

AtomicLong counters seem acceptable here since they are only used when agent debug is enabled. Not sure whether we'll need our own high-throughput counters in instrumentation, since typically that kind of work will be delegated to the Metrics API.

@trask
Copy link
Member

trask commented Nov 19, 2021

/easycla

@trask trask merged commit ee32c41 into open-telemetry:main Nov 19, 2021
@mateuszrzeszutek mateuszrzeszutek deleted the remove-classvalue-longadder branch November 29, 2021 11:08
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this pull request May 23, 2022
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.

Remove LongAdder and ClassValue usages from instrumentation-api
3 participants