-
Notifications
You must be signed in to change notification settings - Fork 860
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
Jetty-based benchmark for memory usage #329
Conversation
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.
Looks great! A couple of comments below.
benchmark/src/jmh/java/io/opentelemetry/benchmark/HttpBenchmark.java
Outdated
Show resolved
Hide resolved
@@ -25,6 +30,7 @@ jmh { | |||
|
|||
// profilers = ['stack:lines=5;detailLine=true;period=5;excludePackages=true'] | |||
// Use profilers to collect additional data. Supported profilers: [cl, comp, gc, stack, perf, perfnorm, perfasm, xperf, xperfasm, hs_cl, hs_comp, hs_gc, hs_rt, hs_thr] | |||
profilers = ['io.opentelemetry.benchmark.UsedMemoryProfiler', 'gc'] |
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 is cool, I hadn't seen custom profiler before.
benchmark/src/jmh/java/io/opentelemetry/benchmark/UsedMemoryProfiler.java
Outdated
Show resolved
Hide resolved
benchmark/src/jmh/java/io/opentelemetry/benchmark/UsedMemoryProfiler.java
Outdated
Show resolved
Hide resolved
benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/HttpClass.java
Outdated
Show resolved
Hide resolved
benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/HttpClass.java
Outdated
Show resolved
Hide resolved
benchmark/src/jmh/java/io/opentelemetry/benchmark/classes/HttpClass.java
Outdated
Show resolved
Hide resolved
Co-Authored-By: Trask Stalnaker <trask.stalnaker@gmail.com>
Co-Authored-By: Trask Stalnaker <trask.stalnaker@gmail.com>
Co-Authored-By: Trask Stalnaker <trask.stalnaker@gmail.com>
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 PR attempts at measuring what is the impact of having the agent on the memory profile of app. Essentially a first part of issue: #312
I added a basic custom memory profiler that measures the amount of memory consumed before and after the series of operations.
The benchmark runs an embedded Jetty server with a basic servlet and runs a series of GET requests. Both parts should be automatically instrumented and impact memory and cpu usage.
Running this locally on macOS and OpenJDK 11.0.6, I got following results:
Raw benchmark results: