Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
阿信在这里
SkyWalking
提交
e8b4d268
S
SkyWalking
项目概览
阿信在这里
/
SkyWalking
与 Fork 源项目一致
Fork自
山不在高_有仙则灵 / 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,发现更多精彩内容 >>
提交
e8b4d268
编写于
7月 22, 2016
作者:
A
ascrutae
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1. 提交Tomcat插件,支持7.x-8.x
2. 修复错误类名(InstanceMethodsAroundInterceptor)
上级
9ec5a464
变更
35
隐藏空白更改
内联
并排
Showing
35 changed file
with
464 addition
and
112 deletion
+464
-112
.gitignore
.gitignore
+0
-53
skywalking-collector/skywalking-agent/pom.xml
skywalking-collector/skywalking-agent/pom.xml
+17
-0
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/invoke/monitor/BaseInvokeMonitor.java
...ai/cloud/skywalking/invoke/monitor/BaseInvokeMonitor.java
+4
-10
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/invoke/monitor/RPCServerInvokeMonitor.java
...oud/skywalking/invoke/monitor/RPCServerInvokeMonitor.java
+0
-7
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/assist/SimpleObjectFirstInvokeInterceptor.java
...nterceptor/assist/SimpleObjectFirstInvokeInterceptor.java
+2
-2
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassConstructorInterceptor.java
...ugin/interceptor/enhance/ClassConstructorInterceptor.java
+2
-2
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassEnhancePluginDefine.java
.../plugin/interceptor/enhance/ClassEnhancePluginDefine.java
+3
-3
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassInstanceMethodsInterceptor.java
.../interceptor/enhance/ClassInstanceMethodsInterceptor.java
+2
-2
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassStaticMethodsEnhancePluginDefine.java
...ceptor/enhance/ClassStaticMethodsEnhancePluginDefine.java
+1
-1
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/InstanceMethodsAroundInterceptor.java
...interceptor/enhance/InstanceMethodsAroundInterceptor.java
+1
-1
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/protocol/util/ContextGenerator.java
...m/ai/cloud/skywalking/protocol/util/ContextGenerator.java
+0
-8
skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/matcher/TestAroundInterceptor.java
...est/java/test/ai/cloud/matcher/TestAroundInterceptor.java
+2
-2
skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/matcher/TestMatcherDefine.java
...rc/test/java/test/ai/cloud/matcher/TestMatcherDefine.java
+2
-2
skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/plugin/TestAroundInterceptor.java
...test/java/test/ai/cloud/plugin/TestAroundInterceptor.java
+2
-2
skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/plugin/TestInterceptorDefine.java
...test/java/test/ai/cloud/plugin/TestInterceptorDefine.java
+2
-2
skywalking-collector/skywalking-sdk-plugin/httpClient-4.x-plugin/src/main/java/com/ai/cloud/skywalking/httpClient/v4/plugin/HttpClientExecuteInterceptor.java
...ng/httpClient/v4/plugin/HttpClientExecuteInterceptor.java
+2
-2
skywalking-collector/skywalking-sdk-plugin/httpClient-4.x-plugin/src/main/java/com/ai/cloud/skywalking/httpClient/v4/plugin/define/HttpClientPluginDefine.java
...g/httpClient/v4/plugin/define/HttpClientPluginDefine.java
+2
-2
skywalking-collector/skywalking-sdk-plugin/jedis-2.x-plugin/pom.xml
...-collector/skywalking-sdk-plugin/jedis-2.x-plugin/pom.xml
+0
-6
skywalking-collector/skywalking-sdk-plugin/jedis-2.x-plugin/src/main/java/com/ai/cloud/skywalking/jedis/v2/plugin/define/JedisClusterPluginDefine.java
...king/jedis/v2/plugin/define/JedisClusterPluginDefine.java
+2
-2
skywalking-collector/skywalking-sdk-plugin/jedis-2.x-plugin/src/main/java/com/ai/cloud/skywalking/jedis/v2/plugin/define/JedisPluginDefine.java
.../skywalking/jedis/v2/plugin/define/JedisPluginDefine.java
+2
-2
skywalking-collector/skywalking-sdk-plugin/pom.xml
skywalking-collector/skywalking-sdk-plugin/pom.xml
+6
-0
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/pom.xml
...ector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/pom.xml
+53
-0
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/com/ai/cloud/skywalking/plugin/tomcat78x/TomcatPluginInterceptor.java
.../skywalking/plugin/tomcat78x/TomcatPluginInterceptor.java
+72
-0
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/com/ai/cloud/skywalking/plugin/tomcat78x/WebBuriedPointType.java
...cloud/skywalking/plugin/tomcat78x/WebBuriedPointType.java
+31
-0
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/com/ai/cloud/skywalking/plugin/tomcat78x/define/TomcatPluginDefine.java
...kywalking/plugin/tomcat78x/define/TomcatPluginDefine.java
+27
-0
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/resources/skywalking-plugin.def
...t-7.x-8.x-plugin/src/main/resources/skywalking-plugin.def
+1
-0
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/test/java/test/com/ai/cloud/skywalking/plugin/tomcat78x/EmbedTomcat.java
...com/ai/cloud/skywalking/plugin/tomcat78x/EmbedTomcat.java
+39
-0
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/test/java/test/com/ai/cloud/skywalking/plugin/tomcat78x/TomcatPluginTest.java
...i/cloud/skywalking/plugin/tomcat78x/TomcatPluginTest.java
+62
-0
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/test/java/test/com/ai/cloud/skywalking/plugin/tomcat78x/servlet/HelloServlet.java
...oud/skywalking/plugin/tomcat78x/servlet/HelloServlet.java
+23
-0
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/test/resources/sky-walking.auth
...tomcat-7.x-8.x-plugin/src/test/resources/sky-walking.auth
+45
-0
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/test/resources/webapp/HelloWorld.jsp
...t-7.x-8.x-plugin/src/test/resources/webapp/HelloWorld.jsp
+5
-0
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/target/classes/skywalking-plugin.def
...omcat-7.x-8.x-plugin/target/classes/skywalking-plugin.def
+1
-0
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/target/test-classes/sky-walking.auth
...omcat-7.x-8.x-plugin/target/test-classes/sky-walking.auth
+45
-0
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/target/test-classes/webapp/HelloWorld.jsp
...-7.x-8.x-plugin/target/test-classes/webapp/HelloWorld.jsp
+5
-0
test/skywalking-test-api/src/main/java/com/ai/skywalking/testframework/api/config/Config.java
...va/com/ai/skywalking/testframework/api/config/Config.java
+1
-1
未找到文件。
.gitignore
已删除
100644 → 0
浏览文件 @
9ec5a464
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files
*.jar
*.war
*.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
.idea/
samples/skywalking-auth/skywalking-auth.iml
samples/skywalking-auth/target/
skywalking-alarm/skywalking-alarm.iml
skywalking-alarm/target/
skywalking-analysis/skywalking-analysis.iml
skywalking-analysis/target/
skywalking-collector/skywalking-agent/dependency-reduced-pom.xml
skywalking-collector/skywalking-agent/skywalking-agent.iml
skywalking-collector/skywalking-agent/target/
skywalking-collector/skywalking-api/skywalking-api.iml
skywalking-collector/skywalking-collector.iml
skywalking-collector/skywalking-log/example/example.iml
skywalking-collector/skywalking-log/log4j-1.x-plugin/skywalking-log4j-1.x-plugin.iml
skywalking-collector/skywalking-log/log4j-2.x-plugin/skywalking-log4j-2.x-plugin.iml
skywalking-collector/skywalking-log/skywalking-log.iml
skywalking-collector/skywalking-protocol/skywalking-protocol.iml
skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/skywalking-dubbo-plugin.iml
skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/target/
skywalking-collector/skywalking-sdk-plugin/httpClient-4.x-plugin/skywalking-httpClient-4.x-plugin.iml
skywalking-collector/skywalking-sdk-plugin/httpClient-4.x-plugin/target/
skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/skywalking-jdbc-plugin.iml
skywalking-sdk-plugin/jdbc-plugin/target/
skywalking-collector/skywalking-sdk-plugin/jedis-2.x-plugin/skywalking-jedis-2.x-plugin.iml
skywalking-collector/skywalking-sdk-plugin/jedis-2.x-plugin/target/
skywalking-collector/skywalking-sdk-plugin/spring-plugin/skywalking-spring-plugin.iml
skywalking-collector/skywalking-sdk-plugin/spring-plugin/target/
skywalking-collector/skywalking-sdk-plugin/web-plugin/skywalking-web-plugin.iml
skywalking-collector/skywalking-sdk-plugin/web-plugin/target/
skywalking-server/target/
skywalking-webui/skywalking-webui.iml
skywalking.iml
test/skywalking-agent-test/.idea/
test/skywalking-agent-test/dubbo-test/
test/skywalking-agent-test/jdbc-test/jdbc-test.iml
test/skywalking-agent-test/redis-test/redis-test.iml
test/skywalking-test-api/skywalking-test-api.iml
test/skywalking-test-api/target/
skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/target/
.gitignore
skywalking-collector/skywalking-log/logback-plugin/logback-plugin.iml
skywalking-collector/skywalking-agent/pom.xml
浏览文件 @
e8b4d268
...
...
@@ -23,6 +23,10 @@
<shade.io.netty.target>
com.ai.cloud.skywalking.api.dependencies.io.netty
</shade.io.netty.target>
<shade.com.google.protobuf.source>
com.google.protobuf
</shade.com.google.protobuf.source>
<shade.com.google.protobuf.target>
com.ai.cloud.skywalking.api.dependencies.google.protobuf
</shade.com.google.protobuf.target>
<shade.javassist.source>
javassist
</shade.javassist.source>
<shade.javassist.target>
com.ai.cloud.skywalking.api.dependencies.javassist
</shade.javassist.target>
<shade.com.google.gson.source>
com.google.gson
</shade.com.google.gson.source>
<shade.com.google.gson.target>
com.ai.cloud.skywalking.api.dependencies.com.google.gson
</shade.com.google.gson.target>
</properties>
<dependencies>
...
...
@@ -46,6 +50,11 @@
<artifactId>
skywalking-dubbo-plugin
</artifactId>
<version>
1.0-Final
</version>
</dependency>
<dependency>
<groupId>
com.ai.cloud
</groupId>
<artifactId>
tomcat-8.x-plugin
</artifactId>
<version>
1.0-Final
</version>
</dependency>
</dependencies>
<build>
<plugins>
...
...
@@ -88,6 +97,14 @@
<pattern>
${shade.com.google.protobuf.source}
</pattern>
<shadedPattern>
${shade.com.google.protobuf.target}
</shadedPattern>
</relocation>
<relocation>
<pattern>
${shade.javassist.source}
</pattern>
<shadedPattern>
${shade.javassist.target}
</shadedPattern>
</relocation>
<relocation>
<pattern>
${shade.com.google.gson.source}
</pattern>
<shadedPattern>
${shade.com.google.gson.target}
</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
...
...
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/invoke/monitor/BaseInvokeMonitor.java
浏览文件 @
e8b4d268
...
...
@@ -32,12 +32,10 @@ public abstract class BaseInvokeMonitor {
}
if
(!
spanData
.
isValidate
())
{
// 根据SpanData生成RequestSpan,并保存
ContextBuffer
.
save
(
RequestSpan
.
RequestSpanBuilder
.
newBuilder
(
spanData
).
callType
(
id
.
getCallType
()).
viewPoint
(
id
.
getViewPoint
())
.
spanTypeDesc
(
id
.
getSpanTypeDesc
()).
build
());
}
// 根据SpanData生成RequestSpan,并保存
ContextBuffer
.
save
(
RequestSpan
.
RequestSpanBuilder
.
newBuilder
(
spanData
).
callType
(
id
.
getCallType
()).
viewPoint
(
id
.
getViewPoint
())
.
spanTypeDesc
(
id
.
getSpanTypeDesc
()).
build
());
// 将新创建的Context存放到ThreadLocal栈中。
CurrentThreadSpanStack
.
push
(
spanData
);
...
...
@@ -56,10 +54,6 @@ public abstract class BaseInvokeMonitor {
// 弹出上下文的栈顶中的元素
Span
spanData
=
CurrentThreadSpanStack
.
pop
();
if
(
spanData
==
null
||
spanData
.
isValidate
())
{
return
;
}
spanData
.
setInvokeResult
(
invokeResult
);
if
(
Config
.
BuriedPoint
.
PRINTF
)
{
...
...
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/invoke/monitor/RPCServerInvokeMonitor.java
浏览文件 @
e8b4d268
...
...
@@ -25,8 +25,6 @@ public class RPCServerInvokeMonitor extends BaseInvokeMonitor {
// 设置是否为接收端
spanData
.
setSpanType
(
SpanType
.
RPC_SERVER
);
invalidateAllSpanIfIsNotFirstSpan
(
spanData
);
super
.
beforeInvoke
(
spanData
,
id
);
}
catch
(
Throwable
t
)
{
logger
.
error
(
t
.
getMessage
(),
t
);
...
...
@@ -42,9 +40,4 @@ public class RPCServerInvokeMonitor extends BaseInvokeMonitor {
super
.
occurException
(
th
);
}
private
void
invalidateAllSpanIfIsNotFirstSpan
(
Span
spanData
)
{
if
(!
CurrentThreadSpanStack
.
peek
().
getTraceId
().
equals
(
spanData
.
getTraceId
()))
{
CurrentThreadSpanStack
.
invalidatePresentSpans
();
}
}
}
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/assist/SimpleObjectFirstInvokeInterceptor.java
浏览文件 @
e8b4d268
...
...
@@ -4,7 +4,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import
com.ai.cloud.skywalking.plugin.interceptor.EnhancedClassInstanceContext
;
import
com.ai.cloud.skywalking.plugin.interceptor.InterceptorException
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.IntanceMethodsAroundInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.In
s
tanceMethodsAroundInterceptor
;
/**
* 用于首次拦截方法调用,避免方法内部的方法调用被多次拦截。
...
...
@@ -12,7 +12,7 @@ import com.ai.cloud.skywalking.plugin.interceptor.enhance.IntanceMethodsAroundIn
* @author wusheng
*
*/
public
abstract
class
SimpleObjectFirstInvokeInterceptor
implements
IntanceMethodsAroundInterceptor
{
public
abstract
class
SimpleObjectFirstInvokeInterceptor
implements
In
s
tanceMethodsAroundInterceptor
{
protected
String
invokeCounterKey
=
"__$invokeCounterKey"
;
protected
Object
invokeCounterInstLock
=
new
Object
();
...
...
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassConstructorInterceptor.java
浏览文件 @
e8b4d268
...
...
@@ -13,9 +13,9 @@ public class ClassConstructorInterceptor {
private
static
Logger
logger
=
LogManager
.
getLogger
(
ClassConstructorInterceptor
.
class
);
private
IntanceMethodsAroundInterceptor
interceptor
;
private
In
s
tanceMethodsAroundInterceptor
interceptor
;
public
ClassConstructorInterceptor
(
IntanceMethodsAroundInterceptor
interceptor
)
{
public
ClassConstructorInterceptor
(
In
s
tanceMethodsAroundInterceptor
interceptor
)
{
this
.
interceptor
=
interceptor
;
}
...
...
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassEnhancePluginDefine.java
浏览文件 @
e8b4d268
...
...
@@ -52,9 +52,9 @@ public abstract class ClassEnhancePluginDefine extends AbstractClassEnhancePlugi
* 2.intercept constructor by default, and intercept method which it's
* required by interceptorDefineClass. <br/>
*/
IntanceMethodsAroundInterceptor
interceptor
=
getInstanceMethodsInterceptor
();
In
s
tanceMethodsAroundInterceptor
interceptor
=
getInstanceMethodsInterceptor
();
if
(
interceptor
==
null
)
{
throw
new
EnhanceException
(
"no IntanceMethodsAroundInterceptor instance. "
);
throw
new
EnhanceException
(
"no In
s
tanceMethodsAroundInterceptor instance. "
);
}
newClassBuilder
=
newClassBuilder
...
...
@@ -116,7 +116,7 @@ public abstract class ClassEnhancePluginDefine extends AbstractClassEnhancePlugi
*
* @return
*/
protected
abstract
IntanceMethodsAroundInterceptor
getInstanceMethodsInterceptor
();
protected
abstract
In
s
tanceMethodsAroundInterceptor
getInstanceMethodsInterceptor
();
private
DynamicType
.
Builder
<?>
enhanceClass
(
String
enhanceOriginClassName
,
DynamicType
.
Builder
<?>
newClassBuilder
)
throws
PluginException
{
...
...
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassInstanceMethodsInterceptor.java
浏览文件 @
e8b4d268
...
...
@@ -17,9 +17,9 @@ public class ClassInstanceMethodsInterceptor {
private
static
Logger
logger
=
LogManager
.
getLogger
(
ClassInstanceMethodsInterceptor
.
class
);
private
IntanceMethodsAroundInterceptor
interceptor
;
private
In
s
tanceMethodsAroundInterceptor
interceptor
;
public
ClassInstanceMethodsInterceptor
(
IntanceMethodsAroundInterceptor
interceptor
)
{
public
ClassInstanceMethodsInterceptor
(
In
s
tanceMethodsAroundInterceptor
interceptor
)
{
this
.
interceptor
=
interceptor
;
}
...
...
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassStaticMethodsEnhancePluginDefine.java
浏览文件 @
e8b4d268
...
...
@@ -17,7 +17,7 @@ public abstract class ClassStaticMethodsEnhancePluginDefine extends
}
@Override
protected
IntanceMethodsAroundInterceptor
getInstanceMethodsInterceptor
()
{
protected
In
s
tanceMethodsAroundInterceptor
getInstanceMethodsInterceptor
()
{
return
null
;
}
}
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/IntanceMethodsAroundInterceptor.java
→
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/In
s
tanceMethodsAroundInterceptor.java
浏览文件 @
e8b4d268
...
...
@@ -2,7 +2,7 @@ package com.ai.cloud.skywalking.plugin.interceptor.enhance;
import
com.ai.cloud.skywalking.plugin.interceptor.EnhancedClassInstanceContext
;
public
interface
IntanceMethodsAroundInterceptor
{
public
interface
In
s
tanceMethodsAroundInterceptor
{
public
void
onConstruct
(
EnhancedClassInstanceContext
context
,
ConstructorInvokeContext
interceptorContext
);
public
void
beforeMethod
(
EnhancedClassInstanceContext
context
,
InstanceMethodInvokeContext
interceptorContext
,
MethodInterceptResult
result
);
...
...
skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/protocol/util/ContextGenerator.java
浏览文件 @
e8b4d268
...
...
@@ -59,14 +59,6 @@ public final class ContextGenerator {
// LevelId是由SpanNode类的nextSubSpanLevelId字段进行初始化的.
// 所以在这里不需要初始化
span
=
new
Span
(
parentSpan
.
getTraceId
(),
Config
.
SkyWalking
.
APPLICATION_CODE
,
Config
.
SkyWalking
.
USER_ID
);
// check parent span is RPC span
// if true, current span is invalidate and current span also belong to RPC span
if
(
parentSpan
.
isRPCClientSpan
())
{
span
.
setSpanType
(
SpanType
.
RPC_CLIENT
);
span
.
setValidate
(
false
);
}
if
(!
StringUtil
.
isEmpty
(
parentSpan
.
getParentLevel
()))
{
span
.
setParentLevel
(
parentSpan
.
getParentLevel
()
+
"."
+
parentSpan
.
getLevelId
());
}
else
{
...
...
skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/matcher/TestAroundInterceptor.java
浏览文件 @
e8b4d268
...
...
@@ -3,13 +3,13 @@ package test.ai.cloud.matcher;
import
com.ai.cloud.skywalking.plugin.interceptor.EnhancedClassInstanceContext
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.ConstructorInvokeContext
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.InstanceMethodInvokeContext
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.IntanceMethodsAroundInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.In
s
tanceMethodsAroundInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.MethodInterceptResult
;
/**
* Created by xin on 16-6-8.
*/
public
class
TestAroundInterceptor
implements
IntanceMethodsAroundInterceptor
{
public
class
TestAroundInterceptor
implements
In
s
tanceMethodsAroundInterceptor
{
@Override
public
void
onConstruct
(
EnhancedClassInstanceContext
context
,
ConstructorInvokeContext
interceptorContext
)
{
...
...
skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/matcher/TestMatcherDefine.java
浏览文件 @
e8b4d268
...
...
@@ -2,7 +2,7 @@ package test.ai.cloud.matcher;
import
com.ai.cloud.skywalking.plugin.interceptor.MethodMatcher
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.IntanceMethodsAroundInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.In
s
tanceMethodsAroundInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.matcher.PrivateMethodMatcher
;
/**
...
...
@@ -28,7 +28,7 @@ public class TestMatcherDefine extends ClassInstanceMethodsEnhancePluginDefine {
}
@Override
protected
IntanceMethodsAroundInterceptor
getInstanceMethodsInterceptor
()
{
protected
In
s
tanceMethodsAroundInterceptor
getInstanceMethodsInterceptor
()
{
return
new
TestAroundInterceptor
();
}
}
skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/plugin/TestAroundInterceptor.java
浏览文件 @
e8b4d268
...
...
@@ -3,10 +3,10 @@ package test.ai.cloud.plugin;
import
com.ai.cloud.skywalking.plugin.interceptor.EnhancedClassInstanceContext
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.ConstructorInvokeContext
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.InstanceMethodInvokeContext
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.IntanceMethodsAroundInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.In
s
tanceMethodsAroundInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.MethodInterceptResult
;
public
class
TestAroundInterceptor
implements
IntanceMethodsAroundInterceptor
{
public
class
TestAroundInterceptor
implements
In
s
tanceMethodsAroundInterceptor
{
@Override
public
void
onConstruct
(
EnhancedClassInstanceContext
context
,
ConstructorInvokeContext
interceptorContext
)
{
...
...
skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/plugin/TestInterceptorDefine.java
浏览文件 @
e8b4d268
...
...
@@ -2,7 +2,7 @@ package test.ai.cloud.plugin;
import
com.ai.cloud.skywalking.plugin.interceptor.MethodMatcher
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.ClassEnhancePluginDefine
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.IntanceMethodsAroundInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.In
s
tanceMethodsAroundInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.StaticMethodsAroundInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.matcher.SimpleMethodMatcher
;
...
...
@@ -19,7 +19,7 @@ public class TestInterceptorDefine extends ClassEnhancePluginDefine {
}
@Override
public
IntanceMethodsAroundInterceptor
getInstanceMethodsInterceptor
()
{
public
In
s
tanceMethodsAroundInterceptor
getInstanceMethodsInterceptor
()
{
return
new
TestAroundInterceptor
();
}
...
...
skywalking-collector/skywalking-sdk-plugin/httpClient-4.x-plugin/src/main/java/com/ai/cloud/skywalking/httpClient/v4/plugin/HttpClientExecuteInterceptor.java
浏览文件 @
e8b4d268
...
...
@@ -8,10 +8,10 @@ import com.ai.cloud.skywalking.model.Identification;
import
com.ai.cloud.skywalking.plugin.interceptor.EnhancedClassInstanceContext
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.ConstructorInvokeContext
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.InstanceMethodInvokeContext
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.IntanceMethodsAroundInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.In
s
tanceMethodsAroundInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.MethodInterceptResult
;
public
class
HttpClientExecuteInterceptor
implements
IntanceMethodsAroundInterceptor
{
public
class
HttpClientExecuteInterceptor
implements
In
s
tanceMethodsAroundInterceptor
{
/**
* default headname of sky walking context<br/>
*/
...
...
skywalking-collector/skywalking-sdk-plugin/httpClient-4.x-plugin/src/main/java/com/ai/cloud/skywalking/httpClient/v4/plugin/define/HttpClientPluginDefine.java
浏览文件 @
e8b4d268
...
...
@@ -3,12 +3,12 @@ package com.ai.cloud.skywalking.httpClient.v4.plugin.define;
import
com.ai.cloud.skywalking.httpClient.v4.plugin.HttpClientExecuteInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.IntanceMethodsAroundInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.In
s
tanceMethodsAroundInterceptor
;
public
abstract
class
HttpClientPluginDefine
extends
ClassInstanceMethodsEnhancePluginDefine
{
@Override
public
IntanceMethodsAroundInterceptor
getInstanceMethodsInterceptor
()
{
public
In
s
tanceMethodsAroundInterceptor
getInstanceMethodsInterceptor
()
{
return
new
HttpClientExecuteInterceptor
();
}
...
...
skywalking-collector/skywalking-sdk-plugin/jedis-2.x-plugin/pom.xml
浏览文件 @
e8b4d268
...
...
@@ -20,12 +20,6 @@
</properties>
<dependencies>
<dependency>
<groupId>
com.ai.cloud
</groupId>
<artifactId>
skywalking-api
</artifactId>
<version>
1.0-Final
</version>
</dependency>
<dependency>
<groupId>
redis.clients
</groupId>
<artifactId>
jedis
</artifactId>
...
...
skywalking-collector/skywalking-sdk-plugin/jedis-2.x-plugin/src/main/java/com/ai/cloud/skywalking/jedis/v2/plugin/define/JedisClusterPluginDefine.java
浏览文件 @
e8b4d268
...
...
@@ -3,7 +3,7 @@ package com.ai.cloud.skywalking.jedis.v2.plugin.define;
import
com.ai.cloud.skywalking.jedis.v2.plugin.JedisClusterInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.MethodMatcher
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.IntanceMethodsAroundInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.In
s
tanceMethodsAroundInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.matcher.AnyMethodsMatcher
;
public
class
JedisClusterPluginDefine
extends
ClassInstanceMethodsEnhancePluginDefine
{
...
...
@@ -21,7 +21,7 @@ public class JedisClusterPluginDefine extends ClassInstanceMethodsEnhancePluginD
}
@Override
public
IntanceMethodsAroundInterceptor
getInstanceMethodsInterceptor
()
{
public
In
s
tanceMethodsAroundInterceptor
getInstanceMethodsInterceptor
()
{
return
new
JedisClusterInterceptor
();
}
}
skywalking-collector/skywalking-sdk-plugin/jedis-2.x-plugin/src/main/java/com/ai/cloud/skywalking/jedis/v2/plugin/define/JedisPluginDefine.java
浏览文件 @
e8b4d268
...
...
@@ -3,7 +3,7 @@ package com.ai.cloud.skywalking.jedis.v2.plugin.define;
import
com.ai.cloud.skywalking.jedis.v2.plugin.JedisInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.MethodMatcher
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.IntanceMethodsAroundInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.In
s
tanceMethodsAroundInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.matcher.MethodsExclusiveMatcher
;
import
com.ai.cloud.skywalking.plugin.interceptor.matcher.PrivateMethodMatcher
;
import
com.ai.cloud.skywalking.plugin.interceptor.matcher.SimpleMethodMatcher
;
...
...
@@ -32,7 +32,7 @@ public class JedisPluginDefine extends ClassInstanceMethodsEnhancePluginDefine {
}
@Override
public
IntanceMethodsAroundInterceptor
getInstanceMethodsInterceptor
()
{
public
In
s
tanceMethodsAroundInterceptor
getInstanceMethodsInterceptor
()
{
return
new
JedisInterceptor
();
}
...
...
skywalking-collector/skywalking-sdk-plugin/pom.xml
浏览文件 @
e8b4d268
...
...
@@ -17,6 +17,7 @@
<module>
web-plugin
</module>
<module>
httpClient-4.x-plugin
</module>
<module>
jedis-2.x-plugin
</module>
<module>
tomcat-7.x-8.x-plugin
</module>
</modules>
<packaging>
pom
</packaging>
...
...
@@ -35,6 +36,11 @@
<version>
1.0-Final
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
com.ai.cloud
</groupId>
<artifactId>
skywalking-api
</artifactId>
<version>
1.0-Final
</version>
</dependency>
</dependencies>
<build>
...
...
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/pom.xml
0 → 100644
浏览文件 @
e8b4d268
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
skywalking-sdk-plugin
</artifactId>
<groupId>
com.ai.cloud
</groupId>
<version>
1.0-Final
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
tomcat-7.x-8.x-plugin
</artifactId>
<packaging>
jar
</packaging>
<name>
tomcat-7.x-8.x-plugin
</name>
<url>
http://maven.apache.org
</url>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<tomcat.version>
8.0.36
</tomcat.version>
</properties>
<dependencies>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.12
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.apache.tomcat.embed
</groupId>
<artifactId>
tomcat-embed-core
</artifactId>
<version>
${tomcat.version}
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.apache.tomcat.embed
</groupId>
<artifactId>
tomcat-embed-logging-juli
</artifactId>
<version>
${tomcat.version}
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.apache.tomcat.embed
</groupId>
<artifactId>
tomcat-embed-jasper
</artifactId>
<version>
${tomcat.version}
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<artifactId>
httpclient
</artifactId>
<version>
4.5.2
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
</project>
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/com/ai/cloud/skywalking/plugin/tomcat78x/TomcatPluginInterceptor.java
0 → 100644
浏览文件 @
e8b4d268
package
com.ai.cloud.skywalking.plugin.tomcat78x
;
import
com.ai.cloud.skywalking.api.Tracing
;
import
com.ai.cloud.skywalking.invoke.monitor.RPCServerInvokeMonitor
;
import
com.ai.cloud.skywalking.model.ContextData
;
import
com.ai.cloud.skywalking.model.Identification
;
import
com.ai.cloud.skywalking.plugin.interceptor.EnhancedClassInstanceContext
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.ConstructorInvokeContext
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.InstanceMethodInvokeContext
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.MethodInterceptResult
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
public
class
TomcatPluginInterceptor
implements
InstanceMethodsAroundInterceptor
{
private
final
String
secondKey
=
"ContextData"
;
private
String
tracingName
=
DEFAULT_TRACE_NAME
;
private
static
final
String
DEFAULT_TRACE_NAME
=
"SkyWalking-TRACING-NAME"
;
private
static
final
String
TRACE_ID_HEADER_NAME
=
"SW-TraceId"
;
@Override
public
void
onConstruct
(
EnhancedClassInstanceContext
context
,
ConstructorInvokeContext
interceptorContext
)
{
//DO Nothing
}
@Override
public
void
beforeMethod
(
EnhancedClassInstanceContext
context
,
InstanceMethodInvokeContext
interceptorContext
,
MethodInterceptResult
result
)
{
Object
[]
args
=
interceptorContext
.
allArguments
();
HttpServletRequest
requests
=
(
HttpServletRequest
)
args
[
0
];
String
tracingHeaderValue
=
requests
.
getHeader
(
tracingName
);
ContextData
contextData
=
null
;
if
(
tracingHeaderValue
!=
null
)
{
String
contextDataStr
=
null
;
int
index
=
tracingHeaderValue
.
indexOf
(
"="
);
if
(
index
>
0
)
{
String
key
=
tracingHeaderValue
.
substring
(
0
,
index
);
if
(
secondKey
.
equals
(
key
))
{
contextDataStr
=
tracingHeaderValue
.
substring
(
index
+
1
);
}
}
if
(
contextDataStr
!=
null
&&
contextDataStr
.
length
()
>
0
)
{
contextData
=
new
ContextData
(
contextDataStr
);
}
}
RPCServerInvokeMonitor
rpcServerInvokeMonitor
=
new
RPCServerInvokeMonitor
();
rpcServerInvokeMonitor
.
beforeInvoke
(
contextData
,
generateIdentification
(
requests
));
}
private
Identification
generateIdentification
(
HttpServletRequest
request
)
{
return
Identification
.
newBuilder
()
.
viewPoint
(
request
.
getRequestURL
().
toString
())
.
spanType
(
WebBuriedPointType
.
instance
())
.
build
();
}
@Override
public
Object
afterMethod
(
EnhancedClassInstanceContext
context
,
InstanceMethodInvokeContext
interceptorContext
,
Object
ret
)
{
Object
[]
args
=
interceptorContext
.
allArguments
();
HttpServletResponse
httpServletResponse
=
(
HttpServletResponse
)
args
[
1
];
httpServletResponse
.
addHeader
(
TRACE_ID_HEADER_NAME
,
Tracing
.
getTraceId
());
return
ret
;
}
@Override
public
void
handleMethodException
(
Throwable
t
,
EnhancedClassInstanceContext
context
,
InstanceMethodInvokeContext
interceptorContext
,
Object
ret
)
{
// DO Nothing
}
}
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/com/ai/cloud/skywalking/plugin/tomcat78x/WebBuriedPointType.java
0 → 100644
浏览文件 @
e8b4d268
package
com.ai.cloud.skywalking.plugin.tomcat78x
;
import
com.ai.cloud.skywalking.api.IBuriedPointType
;
import
com.ai.cloud.skywalking.protocol.common.CallType
;
public
class
WebBuriedPointType
implements
IBuriedPointType
{
private
static
WebBuriedPointType
webBuriedPointType
;
public
static
IBuriedPointType
instance
()
{
if
(
webBuriedPointType
==
null
)
{
webBuriedPointType
=
new
WebBuriedPointType
();
}
return
webBuriedPointType
;
}
@Override
public
String
getTypeName
()
{
return
"W"
;
}
@Override
public
CallType
getCallType
()
{
return
CallType
.
SYNC
;
}
private
WebBuriedPointType
()
{
// Non
}
}
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/com/ai/cloud/skywalking/plugin/tomcat78x/define/TomcatPluginDefine.java
0 → 100644
浏览文件 @
e8b4d268
package
com.ai.cloud.skywalking.plugin.tomcat78x.define
;
import
com.ai.cloud.skywalking.plugin.interceptor.MethodMatcher
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
com.ai.cloud.skywalking.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
;
import
com.ai.cloud.skywalking.plugin.interceptor.matcher.SimpleMethodMatcher
;
import
com.ai.cloud.skywalking.plugin.tomcat78x.TomcatPluginInterceptor
;
import
org.apache.catalina.connector.Request
;
import
org.apache.catalina.connector.Response
;
public
class
TomcatPluginDefine
extends
ClassInstanceMethodsEnhancePluginDefine
{
@Override
protected
MethodMatcher
[]
getInstanceMethodsMatchers
()
{
return
new
MethodMatcher
[]{
new
SimpleMethodMatcher
(
"invoke"
,
Request
.
class
,
Response
.
class
)};
}
@Override
protected
InstanceMethodsAroundInterceptor
getInstanceMethodsInterceptor
()
{
return
new
TomcatPluginInterceptor
();
}
@Override
protected
String
enhanceClassName
()
{
return
"org.apache.catalina.core.StandardEngineValve"
;
}
}
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/resources/skywalking-plugin.def
0 → 100644
浏览文件 @
e8b4d268
com.ai.cloud.skywalking.plugin.tomcat78x.define.TomcatPluginDefine
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/test/java/test/com/ai/cloud/skywalking/plugin/tomcat78x/EmbedTomcat.java
0 → 100644
浏览文件 @
e8b4d268
package
test.com.ai.cloud.skywalking.plugin.tomcat78x
;
import
org.apache.catalina.LifecycleException
;
import
org.apache.catalina.WebResourceRoot
;
import
org.apache.catalina.core.StandardContext
;
import
org.apache.catalina.startup.Tomcat
;
import
org.apache.catalina.webresources.DirResourceSet
;
import
org.apache.catalina.webresources.StandardRoot
;
import
org.junit.Test
;
import
javax.servlet.ServletException
;
import
java.io.File
;
public
class
EmbedTomcat
{
@Test
public
void
testGetResourcePath
(){
System
.
out
.
println
(
EmbedTomcat
.
class
.
getResource
(
"/"
).
getPath
());
}
@Test
public
void
testStartTomcat
()
throws
ServletException
,
LifecycleException
{
start
();
}
public
static
void
start
()
throws
ServletException
,
LifecycleException
{
String
webappDirLocation
=
EmbedTomcat
.
class
.
getResource
(
"/"
).
getPath
()
+
"webapp/"
;
Tomcat
tomcat
=
new
Tomcat
();
tomcat
.
setPort
(
8080
);
StandardContext
standardContext
=
(
StandardContext
)
tomcat
.
addWebapp
(
"/"
,
new
File
(
webappDirLocation
).
getAbsolutePath
());
File
additionWebInfClasses
=
new
File
(
EmbedTomcat
.
class
.
getResource
(
"/"
).
getPath
());
WebResourceRoot
resourceRoot
=
new
StandardRoot
(
standardContext
);
resourceRoot
.
addPreResources
(
new
DirResourceSet
(
resourceRoot
,
"/WEB-INF/classes"
,
additionWebInfClasses
.
getAbsolutePath
(),
"/"
));
standardContext
.
setResources
(
resourceRoot
);
tomcat
.
start
();
}
}
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/test/java/test/com/ai/cloud/skywalking/plugin/tomcat78x/TomcatPluginTest.java
0 → 100644
浏览文件 @
e8b4d268
package
test.com.ai.cloud.skywalking.plugin.tomcat78x
;
import
com.ai.cloud.skywalking.plugin.TracingBootstrap
;
import
com.ai.skywalking.testframework.api.RequestSpanAssert
;
import
org.apache.catalina.LifecycleException
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.client.ClientProtocolException
;
import
org.apache.http.client.ResponseHandler
;
import
org.apache.http.client.methods.HttpGet
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.util.EntityUtils
;
import
org.junit.Test
;
import
javax.servlet.ServletException
;
import
java.io.IOException
;
import
java.lang.reflect.InvocationTargetException
;
public
class
TomcatPluginTest
{
@Test
public
void
test
()
throws
InvocationTargetException
,
NoSuchMethodException
,
ClassNotFoundException
,
IllegalAccessException
{
TracingBootstrap
.
main
(
new
String
[]{
TomcatPluginTest
.
class
.
getName
()});
}
public
static
void
main
(
String
[]
args
)
throws
ServletException
,
LifecycleException
,
IOException
,
InterruptedException
{
// start tomcat
EmbedTomcat
.
start
();
// curl httpclient
visitURL
(
"http://127.0.0.1:8080/hello"
);
// assert client
RequestSpanAssert
.
assertEquals
(
new
String
[][]{
{
"0"
,
"http://127.0.0.1:8080/hello"
,
""
}
});
}
public
static
void
visitURL
(
String
url
)
throws
IOException
{
CloseableHttpClient
httpclient
=
HttpClients
.
createDefault
();
try
{
HttpGet
httpget
=
new
HttpGet
(
url
);
ResponseHandler
<
String
>
responseHandler
=
new
ResponseHandler
<
String
>()
{
@Override
public
String
handleResponse
(
final
HttpResponse
response
)
throws
ClientProtocolException
,
IOException
{
int
status
=
response
.
getStatusLine
().
getStatusCode
();
if
(
status
>=
200
&&
status
<
300
)
{
HttpEntity
entity
=
response
.
getEntity
();
return
entity
!=
null
?
EntityUtils
.
toString
(
entity
)
:
null
;
}
else
{
throw
new
ClientProtocolException
(
"Unexpected response status: "
+
status
);
}
}
};
String
responseBody
=
httpclient
.
execute
(
httpget
,
responseHandler
);
}
finally
{
httpclient
.
close
();
}
}
}
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/test/java/test/com/ai/cloud/skywalking/plugin/tomcat78x/servlet/HelloServlet.java
0 → 100644
浏览文件 @
e8b4d268
package
test.com.ai.cloud.skywalking.plugin.tomcat78x.servlet
;
import
javax.servlet.ServletException
;
import
javax.servlet.annotation.WebServlet
;
import
javax.servlet.http.HttpServlet
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
/**
* Created by xin on 16/7/22.
*/
@WebServlet
(
name
=
"myServlet"
,
urlPatterns
=
{
"/hello"
}
)
public
class
HelloServlet
extends
HttpServlet
{
@Override
protected
void
doGet
(
HttpServletRequest
req
,
HttpServletResponse
resp
)
throws
ServletException
,
IOException
{
System
.
out
.
println
(
"Hello World"
);
}
}
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/test/resources/sky-walking.auth
0 → 100644
浏览文件 @
e8b4d268
#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
skywalking.auth_override=true
#是否打印数据
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
#最大消费线程数
consumer.max_consumer=0
#消费者最大等待时间
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
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/test/resources/webapp/HelloWorld.jsp
0 → 100644
浏览文件 @
e8b4d268
<html>
<body>
<h2>
Hello World
</h2>
</body>
</html>
\ No newline at end of file
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/target/classes/skywalking-plugin.def
0 → 100644
浏览文件 @
e8b4d268
com.ai.cloud.skywalking.plugin.tomcat8.define.Tomcat8PluginDefine
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/target/test-classes/sky-walking.auth
0 → 100644
浏览文件 @
e8b4d268
#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
skywalking.auth_override=true
#是否打印数据
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
#最大消费线程数
consumer.max_consumer=0
#消费者最大等待时间
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
skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/target/test-classes/webapp/HelloWorld.jsp
0 → 100644
浏览文件 @
e8b4d268
<html>
<body>
<h2>
Hello World
</h2>
</body>
</html>
\ No newline at end of file
test/skywalking-test-api/src/main/java/com/ai/skywalking/testframework/api/config/Config.java
浏览文件 @
e8b4d268
...
...
@@ -2,7 +2,7 @@ package com.ai.skywalking.testframework.api.config;
public
class
Config
{
public
static
String
BUFFER_POOL_CLASS_NAME
=
"com.ai.cloud.skywalking.buffer.
ContextBuffer$
BufferPool"
;
public
static
String
BUFFER_POOL_CLASS_NAME
=
"com.ai.cloud.skywalking.buffer.BufferPool"
;
public
static
String
BUFFER_GROUP_FIELD_NAME
=
"bufferGroups"
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录