Skip to content

Commit

Permalink
Delete unnecessary fields and clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
carrothug committed Jul 27, 2015
1 parent d666c16 commit bdd4bc7
Show file tree
Hide file tree
Showing 8 changed files with 220 additions and 276 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ public static ProfilerConfig load(String pinpointConfigFileName) throws IOExcept
private boolean memcached = true;
private boolean memcachedKeyTrace = false;

private Filter<String> jettyExcludeUrlFilter = new SkipFilter<String>();

private boolean ibatis = true;

private boolean mybatis = true;
Expand Down Expand Up @@ -435,10 +433,6 @@ public boolean isMemcachedKeyTrace() {
return memcachedKeyTrace;
}

public Filter<String> getJettyExcludeUrlFilter() {
return jettyExcludeUrlFilter;
}

//-----------------------------------------
// http apache client 3

Expand Down Expand Up @@ -710,10 +704,6 @@ void readPropertyValues() {
this.memcached = readBoolean("profiler.memcached", true);
this.memcachedKeyTrace = readBoolean("profiler.memcached.keytrace", false);

final String jettyExcludeURL = readString("profiler.jetty.excludeurl", "");
if (!jettyExcludeURL.isEmpty()) {
this.jettyExcludeUrlFilter = new ExcludeUrlFilter(jettyExcludeURL);
}

/**
* apache http client 3
Expand Down Expand Up @@ -985,8 +975,6 @@ public String toString() {
builder.append(memcached);
builder.append(", memcachedKeyTrace=");
builder.append(memcachedKeyTrace);
builder.append(", jettyExcludeUrlFilter=");
builder.append(jettyExcludeUrlFilter);
builder.append(", ibatis=");
builder.append(ibatis);
builder.append(", mybatis=");
Expand Down
5 changes: 5 additions & 0 deletions plugins/jetty/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/target/
/.settings/
/.classpath
/.project
/*.iml
2 changes: 1 addition & 1 deletion plugins/jetty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<dependencies>
<dependency>
<groupId>com.navercorp.pinpoint</groupId>
<artifactId>pinpoint-profiler</artifactId>
<artifactId>pinpoint-bootstrap</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,21 @@
import com.navercorp.pinpoint.bootstrap.config.ExcludeUrlFilter;
import com.navercorp.pinpoint.bootstrap.config.Filter;
import com.navercorp.pinpoint.bootstrap.config.ProfilerConfig;
import com.navercorp.pinpoint.bootstrap.config.SkipFilter;

public class JettyConfiguration {

private Filter<String> jettyExcludeUrlFilter;
private final Filter<String> jettyExcludeUrlFilter;

public JettyConfiguration(ProfilerConfig config) {
final String jettyExcludeURL = config.readString("profiler.tomcat.excludeurl", "");
final String jettyExcludeURL = config.readString("profiler.jetty.excludeurl", "");

if (!jettyExcludeURL.isEmpty()) {
this.jettyExcludeUrlFilter = new ExcludeUrlFilter(jettyExcludeURL);
}
else{
this.jettyExcludeUrlFilter = new SkipFilter<String>();
}
}

public Filter<String> getJettyExcludeUrlFilter() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
public class JettyDetector implements ApplicationTypeDetector, JettyConstants {

private static final String REQUIRED_MAIN_CLASS = "org.eclipse.jetty.start.Main";


@Override
public ServiceType getServerType() {
return JETTY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@

public class JettyPlugin implements ProfilerPlugin, JettyConstants{

@Override
public void setup(ProfilerPluginContext context) {
context.addApplicationTypeDetector(new JettyDetector());
@Override
public void setup(ProfilerPluginContext context) {
context.addApplicationTypeDetector(new JettyDetector());
JettyConfiguration config = new JettyConfiguration(context.getConfig());
addServerInterceptors(context, config);
}
addServerInterceptor(context, config);
}

private void addServerInterceptors(ProfilerPluginContext context, JettyConfiguration config){
ClassFileTransformerBuilder builder = context.getClassFileTransformerBuilder("org.eclipse.jetty.server.Server");
private void addServerInterceptor(ProfilerPluginContext context, JettyConfiguration config){
ClassFileTransformerBuilder builder = context.getClassFileTransformerBuilder("org.eclipse.jetty.server.Server");
builder.injectInterceptor("com.navercorp.pinpoint.plugin.jetty.interceptor.ServerHandleInterceptor", config.getJettyExcludeUrlFilter());
//builder.injectInterceptor("com.navercorp.pinpoint.plugin.jetty.interceptor.ServerHandleAsyncInterceptor");
builder.injectMetadata(METADATA_ASYNC_TRACE_ID);
builder.injectMetadata(METADATA_TRACE);
context.addClassFileTransformer(builder.build());
}
}
Loading

0 comments on commit bdd4bc7

Please sign in to comment.