Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
killuaz丶x
SkyWalking
提交
c02c3f3e
S
SkyWalking
项目概览
killuaz丶x
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c02c3f3e
编写于
3月 17, 2016
作者:
wu-sheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.plugin增加对于拦截所有方法的支持
2.jedis插件工程,上传基本工程结构
上级
dfadae71
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
223 addition
and
0 deletion
+223
-0
skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/EnhanceClazz4Interceptor.java
...ywalking/plugin/interceptor/EnhanceClazz4Interceptor.java
+4
-0
skywalking-sdk-plugin/pom.xml
skywalking-sdk-plugin/pom.xml
+1
-0
skywalking-sdk-plugin/skywalking-jedis-2.x-plugin/pom.xml
skywalking-sdk-plugin/skywalking-jedis-2.x-plugin/pom.xml
+70
-0
skywalking-sdk-plugin/skywalking-jedis-2.x-plugin/src/main/java/org/skywalking/jedis/v2/plugin/JedisInterceptor.java
...java/org/skywalking/jedis/v2/plugin/JedisInterceptor.java
+35
-0
skywalking-sdk-plugin/skywalking-jedis-2.x-plugin/src/main/java/org/skywalking/jedis/v2/plugin/define/JedisPluginDefine.java
.../skywalking/jedis/v2/plugin/define/JedisPluginDefine.java
+26
-0
skywalking-sdk-plugin/skywalking-jedis-2.x-plugin/src/main/resources/skywalking-plugin.def
...jedis-2.x-plugin/src/main/resources/skywalking-plugin.def
+1
-0
skywalking-sdk-plugin/skywalking-jedis-2.x-plugin/src/test/java/org/skywalking/jedis/v2/plugin/JedisTest.java
...c/test/java/org/skywalking/jedis/v2/plugin/JedisTest.java
+23
-0
skywalking-sdk-plugin/skywalking-jedis-2.x-plugin/src/test/resources/log4j2.xml
...skywalking-jedis-2.x-plugin/src/test/resources/log4j2.xml
+16
-0
skywalking-sdk-plugin/skywalking-jedis-2.x-plugin/src/test/resources/sky-walking.auth
...king-jedis-2.x-plugin/src/test/resources/sky-walking.auth
+47
-0
未找到文件。
skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/EnhanceClazz4Interceptor.java
浏览文件 @
c02c3f3e
...
...
@@ -121,6 +121,7 @@ public class EnhanceClazz4Interceptor {
InterceptPoint
[]
methodNameList
=
define
.
getBeInterceptedMethods
();
ClassMethodInterceptor
classMethodInterceptor
=
new
ClassMethodInterceptor
(
interceptor
);
for
(
InterceptPoint
method
:
methodNameList
)
{
logger
.
debug
(
"prepare to enhance class {} method [{}] "
,
enhanceOriginClassName
,
method
.
getMethodName
());
...
...
@@ -134,6 +135,9 @@ public class EnhanceClazz4Interceptor {
named
(
method
.
getMethodName
()).
and
(
takesArguments
(
method
.
getArgNum
()))).
intercept
(
MethodDelegation
.
to
(
classMethodInterceptor
));
}
else
if
(
"*"
.
equals
(
method
.
getMethodName
())){
newClassBuilder
=
newClassBuilder
.
method
(
any
()).
intercept
(
MethodDelegation
.
to
(
classMethodInterceptor
));
}
else
{
newClassBuilder
=
newClassBuilder
.
method
(
named
(
method
.
getMethodName
())).
intercept
(
...
...
skywalking-sdk-plugin/pom.xml
浏览文件 @
c02c3f3e
...
...
@@ -16,6 +16,7 @@
<module>
httpclient-4.3.x-plugin
</module>
<module>
httpClient-4.x-plugin
</module>
<module>
httpClient-4.x-plugin-dubbox-rest-attachment
</module>
<module>
jedis-2.x-plugin
</module>
</modules>
<packaging>
pom
</packaging>
...
...
skywalking-sdk-plugin/skywalking-jedis-2.x-plugin/pom.xml
0 → 100644
浏览文件 @
c02c3f3e
<?xml version="1.0"?>
<project
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
com.ai.cloud
</groupId>
<artifactId>
skywalking-sdk-plugin
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<artifactId>
skywalking-jedis-2.x-plugin
</artifactId>
<packaging>
jar
</packaging>
<name>
jedis-2.x-plugin
</name>
<url>
http://maven.apache.org
</url>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>
com.ai.cloud
</groupId>
<artifactId>
skywalking-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
redis.clients
</groupId>
<artifactId>
jedis
</artifactId>
<version>
2.8.1
</version>
</dependency>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-core
</artifactId>
<version>
2.4.1
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.12
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>
maven-compiler-plugin
</artifactId>
<configuration>
<source>
1.7
</source>
<target>
1.7
</target>
<encoding>
${project.build.sourceEncoding}
</encoding>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-resources-plugin
</artifactId>
<version>
2.4.3
</version>
<configuration>
<encoding>
${project.build.sourceEncoding}
</encoding>
</configuration>
</plugin>
</plugins>
</build>
</project>
skywalking-sdk-plugin/skywalking-jedis-2.x-plugin/src/main/java/org/skywalking/jedis/v2/plugin/JedisInterceptor.java
0 → 100644
浏览文件 @
c02c3f3e
package
org.skywalking.jedis.v2.plugin
;
import
com.ai.cloud.skywalking.plugin.interceptor.ConstructorInvokeContext
;
import
com.ai.cloud.skywalking.plugin.interceptor.EnhancedClassInstanceContext
;
import
com.ai.cloud.skywalking.plugin.interceptor.IAroundInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.MethodInvokeContext
;
public
class
JedisInterceptor
implements
IAroundInterceptor
{
@Override
public
void
onConstruct
(
EnhancedClassInstanceContext
context
,
ConstructorInvokeContext
interceptorContext
)
{
}
@Override
public
void
beforeMethod
(
EnhancedClassInstanceContext
context
,
MethodInvokeContext
interceptorContext
)
{
}
@Override
public
Object
afterMethod
(
EnhancedClassInstanceContext
context
,
MethodInvokeContext
interceptorContext
,
Object
ret
)
{
return
ret
;
}
@Override
public
void
handleMethodException
(
Throwable
t
,
EnhancedClassInstanceContext
context
,
MethodInvokeContext
interceptorContext
,
Object
ret
)
{
}
}
skywalking-sdk-plugin/skywalking-jedis-2.x-plugin/src/main/java/org/skywalking/jedis/v2/plugin/define/JedisPluginDefine.java
0 → 100644
浏览文件 @
c02c3f3e
package
org.skywalking.jedis.v2.plugin.define
;
import
org.skywalking.jedis.v2.plugin.JedisInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.IAroundInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.InterceptPoint
;
import
com.ai.cloud.skywalking.plugin.interceptor.InterceptorDefine
;
public
class
JedisPluginDefine
implements
InterceptorDefine
{
@Override
public
String
getBeInterceptedClassName
()
{
return
"redis.clients.jedis.Jedis"
;
}
@Override
public
InterceptPoint
[]
getBeInterceptedMethods
()
{
return
new
InterceptPoint
[]
{
new
InterceptPoint
(
"*"
)
};
}
@Override
public
IAroundInterceptor
instance
()
{
return
new
JedisInterceptor
();
}
}
skywalking-sdk-plugin/skywalking-jedis-2.x-plugin/src/main/resources/skywalking-plugin.def
0 → 100644
浏览文件 @
c02c3f3e
org.skywalking.jedis.v2.plugin.define.JedisPluginDefine
\ No newline at end of file
skywalking-sdk-plugin/skywalking-jedis-2.x-plugin/src/test/java/org/skywalking/jedis/v2/plugin/JedisTest.java
0 → 100644
浏览文件 @
c02c3f3e
package
org.skywalking.jedis.v2.plugin
;
import
java.lang.reflect.InvocationTargetException
;
import
java.sql.SQLException
;
import
org.junit.Test
;
import
com.ai.cloud.skywalking.plugin.TracingBootstrap
;
public
class
JedisTest
{
@Test
public
void
test
()
throws
IllegalAccessException
,
IllegalArgumentException
,
InvocationTargetException
,
NoSuchMethodException
,
SecurityException
,
ClassNotFoundException
{
TracingBootstrap
.
main
(
new
String
[]
{
"org.skywalking.jedis.v2.plugin.JedisTest"
});
}
public
static
void
main
(
String
[]
args
)
throws
ClassNotFoundException
,
SQLException
,
InterruptedException
{}
}
skywalking-sdk-plugin/skywalking-jedis-2.x-plugin/src/test/resources/log4j2.xml
0 → 100644
浏览文件 @
c02c3f3e
<?xml version="1.0" encoding="UTF-8"?>
<Configuration
status=
"error"
>
<Appenders>
<Console
name=
"Console"
target=
"SYSTEM_OUT"
>
<PatternLayout
pattern=
"%d [%t](%F:%L) %-5level %logger{36} - %msg%n"
/>
</Console>
<Console
name=
"Console2"
target=
"SYSTEM_OUT"
>
<PatternLayout
pattern=
"%d [%t](%F:%L) %-5level %logger{36} - %msg%n"
/>
</Console>
</Appenders>
<Loggers>
<Root
level=
"debug"
>
<AppenderRef
ref=
"Console"
/>
</Root>
</Loggers>
</Configuration>
\ No newline at end of file
skywalking-sdk-plugin/skywalking-jedis-2.x-plugin/src/test/resources/sky-walking.auth
0 → 100644
浏览文件 @
c02c3f3e
#skyWalking用户ID
skywalking.user_id=123
#skyWalking应用编码
skywalking.application_code=test
#skywalking auth的环境变量名字
skywalking.auth_system_env_name=SKYWALKING_RUN
#skywalking数据编码
skywalking.charset=UTF-8
#是否打印数据
buriedpoint.printf=true
#埋点异常的最大长度
buriedpoint.max_exception_stack_length=4000
#业务字段的最大长度
buriedpoint.businesskey_max_length=300
#过滤异常
buriedpoint.exclusive_exceptions=java.lang.RuntimeException
#最大发送者的连接数阀比例
sender.connect_percent=100
#发送服务端配置
sender.servers_addr=127.0.0.1:34000
#最大发送的副本数量
sender.max_copy_num=2
#发送的最大长度
sender.max_send_length=20000
#当没有Sender时,尝试获取sender的等待周期
sender.retry_get_sender_wait_interval=2000
#是否开启发送消息
sender.is_off=false
#最大消费线程数
consumer.max_consumer=2
#消费者最大等待时间
consumer.max_wait_time=5
#发送失败等待时间
consumer.consumer_fail_retry_wait_interval=50
#每个Buffer的最大个数
buffer.buffer_max_size=18000
#Buffer池的最大长度
buffer.pool_size=5
#发送检查线程检查周期
senderchecker.check_polling_time=200
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录