Skip to content

Simplify DynamicTransformer API#2164

Merged
felixbarny merged 4 commits intoelastic:masterfrom
felixbarny:dynamic-transformer-remove-accessor-get
Oct 5, 2021
Merged

Simplify DynamicTransformer API#2164
felixbarny merged 4 commits intoelastic:masterfrom
felixbarny:dynamic-transformer-remove-accessor-get

Conversation

@felixbarny
Copy link
Member

@felixbarny felixbarny commented Oct 1, 2021

What does this PR do?

Instead of DynamicTransformer.Accessor.get().ensureInstrumented,users can just call DynamicTransformer.ensureInstrumented

Makes the API similar in style to the recent changes in WeakConcurrent.

Checklist

Instead of DynamicTransformer.Accessor.get().ensureInstrumented,
users can just call DynamicTransformer.ensureInstrumented
@ghost
Copy link

ghost commented Oct 1, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-10-05T10:13:42.506+0000

  • Duration: 57 min 6 sec

  • Commit: 0df56e4

Test stats 🧪

Test Results
Failed 0
Passed 2417
Skipped 19
Total 2436

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run benchmark tests : Run the benchmark test.

  • run compatibility tests : Run the JDK Compatibility test.

  • run integration tests : Run the APM-ITs.

Copy link
Contributor

@eyalkoren eyalkoren left a comment

Choose a reason for hiding this comment

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

LGTM, only a minor naming suggestion

transformer.ensureInstrumented(classToInstrument, instrumentationClasses);
}

public interface DynamicTransformerSupplier {
Copy link
Contributor

Choose a reason for hiding this comment

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

[minor] I don't think DynamicTransformerSupplier is a good name for this interface. I would call it DynamicTransformer and find a better name for the declaring class, even StaticDynamicTransformer, but preferably something better 🙂

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree that the name of the interface isn't ideal. But I wanted to optimize for the actual user facing class which is DynamicTransformer. While DynamicTransformerSupplier needs to be public, users never really get to see it. Also, it's in line with WeakConcurrentSupplier.

Copy link
Contributor

@eyalkoren eyalkoren Oct 5, 2021

Choose a reason for hiding this comment

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

It's just that DynamicTransformer doesn't supply anything (as opposed to the weak map supplier).
What about RuntimeInstrumentor for the interface?

And an additional suggestion - I just noticed that DynamicTransformerImpl seems redundant, why not make ElasticApmAgent the service provider implementing the interface (whatever it's called 🙂 ). ignore this one, it's static in ElasticApmAgent

Either way, feel free to ignore both suggestions and merge if you disagree. It's not that important.

@felixbarny felixbarny enabled auto-merge (squash) October 5, 2021 10:13
@felixbarny felixbarny merged commit 57d0dbd into elastic:master Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants