-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added JFR configuration which enables only supported JFR event types
- Loading branch information
Showing
8 changed files
with
131 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
agent/src/main/java/io/pyroscope/javaagent/ProfilerDelegate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 22 additions & 1 deletion
23
agent/src/main/java/io/pyroscope/javaagent/config/ProfilerType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,26 @@ | ||
package io.pyroscope.javaagent.config; | ||
|
||
import io.pyroscope.javaagent.AsyncProfilerDelegate; | ||
import io.pyroscope.javaagent.JFRProfilerDelegate; | ||
import io.pyroscope.javaagent.ProfilerDelegate; | ||
|
||
import java.lang.reflect.InvocationTargetException; | ||
|
||
public enum ProfilerType { | ||
JFR, ASYNC; | ||
JFR(JFRProfilerDelegate.class), ASYNC(AsyncProfilerDelegate.class); | ||
|
||
private final Class<? extends ProfilerDelegate> profilerDelegateClass; | ||
|
||
ProfilerType(Class<? extends ProfilerDelegate> profilerDelegateClass) { | ||
this.profilerDelegateClass = profilerDelegateClass; | ||
} | ||
|
||
public ProfilerDelegate create(Config config) { | ||
try { | ||
return profilerDelegateClass.getConstructor(Config.class).newInstance(config); | ||
} catch (InstantiationException | IllegalAccessException | InvocationTargetException | | ||
NoSuchMethodException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<configuration version="2.0" label="Pyroscope" | ||
description="Low overhead configuration safe for continuous use in production environments, typically less than 1 % overhead." | ||
provider="Pyroscope"> | ||
|
||
<event name="jdk.ExecutionSample"> | ||
<setting name="enabled">true</setting> | ||
<setting name="period">1 ms</setting> | ||
</event> | ||
|
||
<event name="jdk.ThreadPark"> | ||
<setting name="enabled">true</setting> | ||
<setting name="stackTrace">true</setting> | ||
<setting name="threshold">10 ms</setting> | ||
</event> | ||
|
||
<event name="jdk.ObjectAllocationInNewTLAB"> | ||
<setting name="enabled">true</setting> | ||
<setting name="stackTrace">true</setting> | ||
</event> | ||
|
||
<event name="jdk.ObjectAllocationOutsideTLAB"> | ||
<setting name="enabled">true</setting> | ||
<setting name="stackTrace">true</setting> | ||
</event> | ||
|
||
<event name="jdk.JavaMonitorEnter"> | ||
<setting name="enabled">true</setting> | ||
<setting name="stackTrace">true</setting> | ||
<setting name="threshold">10 ms</setting> | ||
</event> | ||
|
||
<event name="jdk.ThreadPark"> | ||
<setting name="enabled">true</setting> | ||
<setting name="stackTrace">true</setting> | ||
<setting name="threshold">10 ms</setting> | ||
</event> | ||
|
||
<event name="jdk.ActiveSetting"> | ||
<setting name="enabled">true</setting> | ||
</event> | ||
|
||
</configuration> |