Skip to content

Commit

Permalink
[pinpoint-apm#3423] add redis cluster.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaehong-kim committed Oct 19, 2017
1 parent 0cbc282 commit cf04b97
Show file tree
Hide file tree
Showing 20 changed files with 293 additions and 677 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
* <tr><td>200</td><td>cxf.operation</td></tr>
* <tr><td>201</td><td>cxf.args</td></tr>
* <tr><td>300</td><td>PROXY_HTTP_HEADER</td></tr>
* <tr><td>310</td><td>REDIS.IO</td></tr>
* <tr><td>9000</td><td>gson.json.length</td></tr>
* <tr><td>9001</td><td>jackson.json.length</td></tr>
* <tr><td>9002</td><td>json-lib.json.length</td></tr>
Expand Down Expand Up @@ -195,4 +196,5 @@ public interface AnnotationKey {
AnnotationKey ASYNC = AnnotationKeyFactory.of(-100, "Asynchronous Invocation", VIEW_IN_RECORD_SET);

AnnotationKey PROXY_HTTP_HEADER = AnnotationKeyFactory.of(300, "PROXY_HTTP_HEADER", VIEW_IN_RECORD_SET);
AnnotationKey REDIS_IO = AnnotationKeyFactory.of(310, "redis.io");
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright 2017 NAVER Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.navercorp.pinpoint.plugin.redis;

import com.navercorp.pinpoint.bootstrap.instrument.InstrumentMethod;
import com.navercorp.pinpoint.bootstrap.instrument.MethodFilter;

import java.lang.reflect.Modifier;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

/**
* @author jaehong.kim
*/
public class JedisMethodNameFilter implements MethodFilter {

private final Set<String> excludeMethodNames = new HashSet<String>(16);

public JedisMethodNameFilter() {
// object methods.
this.excludeMethodNames.addAll(Arrays.asList("clone", "equals", "finalize", "getClass", "hashCode", "notify", "notifyAll", "toString", "wait"));
// unnecessary methods.
this.excludeMethodNames.addAll(Arrays.asList("ping", "close", "disconnect", "resetState", "getClient", "setClient", "getDB", "isInMulti", "isInWatch", "clear", "pipelined", "setPassword", "setDb", "setDataSource", "getClusterNodes", "getConnectionFromSlot"));
}

@Override
public boolean accept(final InstrumentMethod method) {
if (method != null) {
final int modifiers = method.getModifiers();
// only public.
if (!Modifier.isPublic(modifiers) || Modifier.isStatic(modifiers) || Modifier.isAbstract(modifiers) || Modifier.isNative(modifiers)) {
return false;
}

final String name = method.getName();
// skip pinpoint and object methods.
if (!name.startsWith("_$PINPOINT$_") && !this.excludeMethodNames.contains(name)) {
return true;
}
}
return false;
}
}

This file was deleted.

This file was deleted.

Loading

0 comments on commit cf04b97

Please sign in to comment.