Skip to content

Commit

Permalink
support multiple events on jfr output
Browse files Browse the repository at this point in the history
  • Loading branch information
dpsoft committed Sep 30, 2023
1 parent 807e13f commit 8cc245c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/spring-boot-pprof-manual/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repositories {
}

dependencies {
implementation 'io.github.dpsoft:ap-agent:0.1.3-SNAPSHOT'
implementation 'io.github.dpsoft:ap-agent:0.1.8'
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.github.dpsoft</groupId>
<artifactId>ap-agent</artifactId>
<version>0.1.7</version>
<version>0.1.8-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<me.bechberger.ap-loader.version>2.9-6</me.bechberger.ap-loader.version>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/github/dpsoft/ap/command/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static Command from(String operation, Map<String, String> params){

public static Command from(String operation, Map<String, String> params, AgentConfiguration configuration) {
final var output = getOutput(params, configuration.handler);
final var eventType = getEventType(operation, params, output, configuration.handler);
final var eventType = getEventType(operation, params, output);
final var duration = getDuration(params);
final var eventParams = getEventParams(params);
final var interval = getInterval(params, configuration.profiler);
Expand Down Expand Up @@ -55,8 +55,8 @@ private static Output getOutput(Map<String, String> params, AgentConfiguration.H
.getOrElse(Output.JFR);
}

private static String getEventType(String segment, Map<String, String> params, Output output, AgentConfiguration.Handler configuration) {
if (configuration.isGoMode()) return GOProfileTypes.get(segment).getOrElse(GOProfileTypes.PROFILE).event();
private static String getEventType(String segment, Map<String, String> params, Output output) {
if (Output.PPROF == output) return GOProfileTypes.get(segment).getOrElse(GOProfileTypes.PROFILE).event();
if (Output.HOT_COLD == output) return Events.WALL;
return params.getOrDefault("event", Events.ITIMER);
}
Expand Down

0 comments on commit 8cc245c

Please sign in to comment.