Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
润土的好友猹
SkyWalking
提交
e1d9701b
S
SkyWalking
项目概览
润土的好友猹
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
9
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,发现更多精彩内容 >>
提交
e1d9701b
编写于
8月 07, 2017
作者:
A
ascrutae
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify field name
上级
630705c1
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
77 addition
and
46 deletion
+77
-46
apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/ContextCarrier.java
...org/skywalking/apm/agent/core/context/ContextCarrier.java
+31
-27
apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/ContextSnapshot.java
...rg/skywalking/apm/agent/core/context/ContextSnapshot.java
+12
-0
apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/TracingContext.java
...org/skywalking/apm/agent/core/context/TracingContext.java
+11
-2
apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/trace/TraceSegmentRef.java
...walking/apm/agent/core/context/trace/TraceSegmentRef.java
+14
-8
apm-sniffer/apm-agent-core/src/test/java/org/skywalking/apm/agent/core/context/ContextManagerTest.java
...skywalking/apm/agent/core/context/ContextManagerTest.java
+2
-2
apm-sniffer/apm-sdk-plugin/dubbo-plugin/src/test/java/org/skywalking/apm/plugin/dubbo/DubboInterceptorTest.java
...org/skywalking/apm/plugin/dubbo/DubboInterceptorTest.java
+2
-2
apm-sniffer/apm-sdk-plugin/motan-plugin/src/test/java/org/skywalking/apm/plugin/motan/MotanProviderInterceptorTest.java
...alking/apm/plugin/motan/MotanProviderInterceptorTest.java
+1
-1
apm-sniffer/apm-sdk-plugin/resin-3.x-plugin/src/test/java/org/skywalking/apm/plugin/resin/v3/ResinV3InterceptorTest.java
...kywalking/apm/plugin/resin/v3/ResinV3InterceptorTest.java
+1
-1
apm-sniffer/apm-sdk-plugin/resin-4.x-plugin/src/test/java/org/skywalking/apm/plugin/resin/v4/ResinV4InterceptorTest.java
...kywalking/apm/plugin/resin/v4/ResinV4InterceptorTest.java
+1
-1
apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/test/java/org/skywalking/apm/plugin/tomcat78x/TomcatInterceptorTest.java
...kywalking/apm/plugin/tomcat78x/TomcatInterceptorTest.java
+1
-1
apm-sniffer/apm-toolkit-activation/apm-toolkit-opentracing-activation/src/test/java/org/skywalking/apm/toolkit/activation/opentracing/SkywalkingSpanActivationTest.java
.../activation/opentracing/SkywalkingSpanActivationTest.java
+1
-1
未找到文件。
apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/ContextCarrier.java
浏览文件 @
e1d9701b
...
...
@@ -10,8 +10,10 @@ import org.skywalking.apm.agent.core.dictionary.DictionaryUtil;
import
org.skywalking.apm.util.StringUtil
;
/**
* {@link ContextCarrier} is a data carrier of {@link TracingContext}. It holds the snapshot (current state) of {@link
* TracingContext}. <p> Created by wusheng on 2017/2/17.
* {@link ContextCarrier} is a data carrier of {@link TracingContext}.
* It holds the snapshot (current state) of {@link TracingContext}.
* <p>
* Created by wusheng on 2017/2/17.
*/
public
class
ContextCarrier
implements
Serializable
{
/**
...
...
@@ -21,7 +23,9 @@ public class ContextCarrier implements Serializable {
private
int
spanId
=
-
1
;
private
int
applicationInstanceId
=
DictionaryUtil
.
nullValue
();
private
int
parentApplicationInstanceId
=
DictionaryUtil
.
nullValue
();
private
int
entryApplicationInstanceId
=
DictionaryUtil
.
nullValue
();
private
String
peerHost
;
...
...
@@ -34,10 +38,9 @@ public class ContextCarrier implements Serializable {
*/
private
DistributedTraceId
primaryDistributedTraceId
;
private
int
entryApplicationInstanceId
=
DictionaryUtil
.
nullValue
();
/**
* Serialize this {@link ContextCarrier} to a {@link String}, with '|' split.
* Serialize this {@link ContextCarrier} to a {@link String},
* with '|' split.
*
* @return the serialization string.
*/
...
...
@@ -46,12 +49,12 @@ public class ContextCarrier implements Serializable {
return
StringUtil
.
join
(
'|'
,
this
.
getTraceSegmentId
().
toBase64
(),
this
.
getSpanId
()
+
""
,
this
.
getApplicationInstanceId
()
+
""
,
this
.
getParentApplicationInstanceId
()
+
""
,
this
.
getEntryApplicationInstanceId
()
+
""
,
this
.
getPeerHost
(),
this
.
getEntryOperationName
(),
this
.
getParentOperationName
(),
this
.
getPrimaryDistributedTraceId
(),
this
.
getEntryApplicationInstanceId
()
+
""
);
this
.
getPrimaryDistributedTraceId
().
toBase64
());
}
else
{
return
""
;
}
...
...
@@ -69,12 +72,12 @@ public class ContextCarrier implements Serializable {
try
{
this
.
traceSegmentId
=
new
ID
(
parts
[
0
]);
this
.
spanId
=
Integer
.
parseInt
(
parts
[
1
]);
this
.
a
pplicationInstanceId
=
Integer
.
parseInt
(
parts
[
2
]);
this
.
peerHost
=
parts
[
3
]
;
this
.
entryOperationName
=
parts
[
4
];
this
.
parent
OperationName
=
parts
[
5
];
this
.
p
rimaryDistributedTraceId
=
new
PropagatedTraceId
(
parts
[
6
])
;
this
.
entryApplicationInstanceId
=
Integer
.
parseInt
(
parts
[
7
]);
this
.
parentA
pplicationInstanceId
=
Integer
.
parseInt
(
parts
[
2
]);
this
.
entryApplicationInstanceId
=
Integer
.
parseInt
(
parts
[
3
])
;
this
.
peerHost
=
parts
[
4
];
this
.
entry
OperationName
=
parts
[
5
];
this
.
p
arentOperationName
=
parts
[
6
]
;
this
.
primaryDistributedTraceId
=
new
PropagatedTraceId
(
parts
[
7
]);
}
catch
(
NumberFormatException
e
)
{
}
...
...
@@ -91,12 +94,12 @@ public class ContextCarrier implements Serializable {
public
boolean
isValid
()
{
return
traceSegmentId
!=
null
&&
getSpanId
()
>
-
1
&&
applicationInstanceId
!=
DictionaryUtil
.
nullValue
()
&&
parentApplicationInstanceId
!=
DictionaryUtil
.
nullValue
()
&&
entryApplicationInstanceId
!=
DictionaryUtil
.
nullValue
()
&&
!
StringUtil
.
isEmpty
(
peerHost
)
&&
!
StringUtil
.
isEmpty
(
entryOperationName
)
&&
!
StringUtil
.
isEmpty
(
parentOperationName
)
&&
primaryDistributedTraceId
!=
null
&&
entryApplicationInstanceId
!=
DictionaryUtil
.
nullValue
();
&&
primaryDistributedTraceId
!=
null
;
}
public
String
getEntryOperationName
()
{
...
...
@@ -135,12 +138,12 @@ public class ContextCarrier implements Serializable {
this
.
spanId
=
spanId
;
}
public
int
getApplicationInstanceId
()
{
return
a
pplicationInstanceId
;
public
int
get
Parent
ApplicationInstanceId
()
{
return
parentA
pplicationInstanceId
;
}
void
set
ApplicationInstanceId
(
int
a
pplicationInstanceId
)
{
this
.
applicationInstanceId
=
a
pplicationInstanceId
;
void
set
ParentApplicationInstanceId
(
int
parentA
pplicationInstanceId
)
{
this
.
parentApplicationInstanceId
=
parentA
pplicationInstanceId
;
}
public
String
getPeerHost
()
{
...
...
@@ -163,19 +166,20 @@ public class ContextCarrier implements Serializable {
this
.
primaryDistributedTraceId
=
distributedTraceIds
.
get
(
0
);
}
private
String
getPrimaryDistributedTraceId
()
{
return
primaryDistributedTraceId
.
toBase64
()
;
private
DistributedTraceId
getPrimaryDistributedTraceId
()
{
return
primaryDistributedTraceId
;
}
public
String
getParentOperationName
()
{
return
parentOperationName
;
}
public
int
getEntryApplicationInstanceId
()
{
return
entryApplicationInstanceId
;
}
public
void
setEntryApplicationInstanceId
(
int
entryApplicationInstanceId
)
{
this
.
entryApplicationInstanceId
=
entryApplicationInstanceId
;
}
public
int
getEntryApplicationInstanceId
()
{
return
entryApplicationInstanceId
;
}
}
apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/ContextSnapshot.java
浏览文件 @
e1d9701b
...
...
@@ -3,6 +3,7 @@ package org.skywalking.apm.agent.core.context;
import
java.util.List
;
import
org.skywalking.apm.agent.core.context.ids.DistributedTraceId
;
import
org.skywalking.apm.agent.core.context.ids.ID
;
import
org.skywalking.apm.agent.core.dictionary.DictionaryUtil
;
import
org.skywalking.apm.util.StringUtil
;
/**
...
...
@@ -31,6 +32,8 @@ public class ContextSnapshot {
*/
private
DistributedTraceId
primaryDistributedTraceId
;
private
int
entryApplicationInstanceId
=
DictionaryUtil
.
nullValue
();
ContextSnapshot
(
ID
traceSegmentId
,
int
spanId
,
List
<
DistributedTraceId
>
distributedTraceIds
)
{
this
.
traceSegmentId
=
traceSegmentId
;
...
...
@@ -75,6 +78,7 @@ public class ContextSnapshot {
public
boolean
isValid
()
{
return
traceSegmentId
!=
null
&&
spanId
>
-
1
&&
entryApplicationInstanceId
!=
DictionaryUtil
.
nullValue
()
&&
primaryDistributedTraceId
!=
null
&&
!
StringUtil
.
isEmpty
(
entryOperationName
)
&&
!
StringUtil
.
isEmpty
(
parentOperationName
);
...
...
@@ -83,4 +87,12 @@ public class ContextSnapshot {
public
String
getEntryOperationName
()
{
return
entryOperationName
;
}
public
void
setEntryApplicationInstanceId
(
int
entryApplicationInstanceId
)
{
this
.
entryApplicationInstanceId
=
entryApplicationInstanceId
;
}
public
int
getEntryApplicationInstanceId
()
{
return
entryApplicationInstanceId
;
}
}
apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/TracingContext.java
浏览文件 @
e1d9701b
...
...
@@ -84,7 +84,7 @@ public class TracingContext implements AbstractTracerContext {
carrier
.
setTraceSegmentId
(
this
.
segment
.
getTraceSegmentId
());
carrier
.
setSpanId
(
span
.
getSpanId
());
carrier
.
setApplicationInstanceId
(
segment
.
getApplicationInstanceId
());
carrier
.
set
Parent
ApplicationInstanceId
(
segment
.
getApplicationInstanceId
());
if
(
DictionaryUtil
.
isNull
(
exitSpan
.
getPeerId
()))
{
carrier
.
setPeerHost
(
exitSpan
.
getPeer
());
...
...
@@ -94,16 +94,20 @@ public class TracingContext implements AbstractTracerContext {
List
<
TraceSegmentRef
>
refs
=
this
.
segment
.
getRefs
();
int
operationId
;
String
operationName
;
int
entryApplicationInstanceId
;
if
(
refs
!=
null
&&
refs
.
size
()
>
0
)
{
TraceSegmentRef
ref
=
refs
.
get
(
0
);
operationId
=
ref
.
getEntryOperationId
();
operationName
=
ref
.
getEntryOperationName
();
entryApplicationInstanceId
=
ref
.
getEntryApplicationInstanceId
();
}
else
{
AbstractTracingSpan
firstSpan
=
first
();
operationId
=
firstSpan
.
getOperationId
();
operationName
=
firstSpan
.
getOperationName
();
carrier
.
setEntryApplicationInstanceId
(
this
.
segment
.
getApplicationInstanceId
()
);
entryApplicationInstanceId
=
this
.
segment
.
getApplicationInstanceId
(
);
}
carrier
.
setEntryApplicationInstanceId
(
entryApplicationInstanceId
);
if
(
operationId
==
DictionaryUtil
.
nullValue
())
{
carrier
.
setEntryOperationName
(
operationName
);
}
else
{
...
...
@@ -146,15 +150,20 @@ public class TracingContext implements AbstractTracerContext {
segment
.
getRelatedGlobalTraces
());
int
entryOperationId
;
String
entryOperationName
;
int
entryApplicationInstanceId
;
AbstractTracingSpan
firstSpan
=
first
();
if
(
refs
!=
null
&&
refs
.
size
()
>
0
)
{
TraceSegmentRef
ref
=
refs
.
get
(
0
);
entryOperationId
=
ref
.
getEntryOperationId
();
entryOperationName
=
ref
.
getEntryOperationName
();
entryApplicationInstanceId
=
ref
.
getEntryApplicationInstanceId
();
}
else
{
entryOperationId
=
firstSpan
.
getOperationId
();
entryOperationName
=
firstSpan
.
getOperationName
();
entryApplicationInstanceId
=
this
.
segment
.
getApplicationInstanceId
();
}
snapshot
.
setEntryApplicationInstanceId
(
entryApplicationInstanceId
);
if
(
entryOperationId
==
DictionaryUtil
.
nullValue
())
{
snapshot
.
setEntryOperationName
(
entryOperationName
);
}
else
{
...
...
apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/trace/TraceSegmentRef.java
浏览文件 @
e1d9701b
package
org.skywalking.apm.agent.core.context.trace
;
import
org.skywalking.apm.agent.core.conf.RemoteDownstreamConfig
;
import
org.skywalking.apm.agent.core.context.ContextCarrier
;
import
org.skywalking.apm.agent.core.context.ContextSnapshot
;
import
org.skywalking.apm.agent.core.context.ids.ID
;
...
...
@@ -20,18 +21,18 @@ public class TraceSegmentRef {
private
int
spanId
=
-
1
;
private
int
applicationInstanceId
;
private
int
peerId
=
DictionaryUtil
.
nullValue
()
;
private
String
peerHost
;
private
int
peerId
=
DictionaryUtil
.
nullValue
();
private
int
entryApplicationInstanceId
=
DictionaryUtil
.
nullValue
();
private
int
parentApplicationInstanceId
=
DictionaryUtil
.
nullValue
();
private
String
entryOperationName
;
private
int
entryOperationId
=
DictionaryUtil
.
nullValue
();
private
int
entryApplicationInstanceId
=
DictionaryUtil
.
nullValue
();
private
String
parentOperationName
;
private
int
parentOperationId
=
DictionaryUtil
.
nullValue
();
...
...
@@ -45,7 +46,7 @@ public class TraceSegmentRef {
this
.
type
=
SegmentRefType
.
CROSS_PROCESS
;
this
.
traceSegmentId
=
carrier
.
getTraceSegmentId
();
this
.
spanId
=
carrier
.
getSpanId
();
this
.
applicationInstanceId
=
carrier
.
ge
tApplicationInstanceId
();
this
.
parentApplicationInstanceId
=
carrier
.
getParen
tApplicationInstanceId
();
this
.
entryApplicationInstanceId
=
carrier
.
getEntryApplicationInstanceId
();
String
host
=
carrier
.
getPeerHost
();
if
(
host
.
charAt
(
0
)
==
'#'
)
{
...
...
@@ -71,6 +72,8 @@ public class TraceSegmentRef {
this
.
type
=
SegmentRefType
.
CROSS_THREAD
;
this
.
traceSegmentId
=
snapshot
.
getTraceSegmentId
();
this
.
spanId
=
snapshot
.
getSpanId
();
this
.
parentApplicationInstanceId
=
RemoteDownstreamConfig
.
Agent
.
APPLICATION_INSTANCE_ID
;
this
.
entryApplicationInstanceId
=
snapshot
.
getEntryApplicationInstanceId
();
String
entryOperationName
=
snapshot
.
getEntryOperationName
();
if
(
entryOperationName
.
charAt
(
0
)
==
'#'
)
{
this
.
entryOperationName
=
entryOperationName
.
substring
(
1
);
...
...
@@ -93,12 +96,15 @@ public class TraceSegmentRef {
return
entryOperationId
;
}
public
int
getEntryApplicationInstanceId
()
{
return
entryApplicationInstanceId
;
}
public
TraceSegmentReference
transform
()
{
TraceSegmentReference
.
Builder
refBuilder
=
TraceSegmentReference
.
newBuilder
();
if
(
SegmentRefType
.
CROSS_PROCESS
.
equals
(
type
))
{
refBuilder
.
setRefType
(
RefType
.
CrossProcess
);
refBuilder
.
setParentApplicationInstanceId
(
applicationInstanceId
);
refBuilder
.
setEntryServiceApplicationInstanceId
(
entryApplicationInstanceId
);
refBuilder
.
setParentApplicationInstanceId
(
parentApplicationInstanceId
);
if
(
peerId
==
DictionaryUtil
.
nullValue
())
{
refBuilder
.
setNetworkAddress
(
peerHost
);
}
else
{
...
...
@@ -108,6 +114,7 @@ public class TraceSegmentRef {
refBuilder
.
setRefType
(
RefType
.
CrossThread
);
}
refBuilder
.
setEntryApplicationInstanceId
(
entryApplicationInstanceId
);
refBuilder
.
setParentTraceSegmentId
(
traceSegmentId
.
transform
());
refBuilder
.
setParentSpanId
(
spanId
);
if
(
entryOperationId
==
DictionaryUtil
.
nullValue
())
{
...
...
@@ -143,7 +150,6 @@ public class TraceSegmentRef {
result
=
31
*
result
+
spanId
;
return
result
;
}
public
enum
SegmentRefType
{
CROSS_PROCESS
,
CROSS_THREAD
...
...
apm-sniffer/apm-agent-core/src/test/java/org/skywalking/apm/agent/core/context/ContextManagerTest.java
浏览文件 @
e1d9701b
...
...
@@ -79,7 +79,7 @@ public class ContextManagerTest {
@Test
public
void
createMultipleEntrySpan
()
{
ContextCarrier
contextCarrier
=
new
ContextCarrier
().
deserialize
(
"#AQA*#AQA*4WcWe0tQNQA*|1|1|
#127.0.0.1:8080|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*|1
"
);
ContextCarrier
contextCarrier
=
new
ContextCarrier
().
deserialize
(
"#AQA*#AQA*4WcWe0tQNQA*|1|1|
1|#127.0.0.1:8080|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*
"
);
assertTrue
(
contextCarrier
.
isValid
());
AbstractSpan
firstEntrySpan
=
ContextManager
.
createEntrySpan
(
"/testFirstEntry"
,
contextCarrier
);
...
...
@@ -202,7 +202,7 @@ public class ContextManagerTest {
@Test
public
void
testTransform
()
throws
InvalidProtocolBufferException
{
ContextCarrier
contextCarrier
=
new
ContextCarrier
().
deserialize
(
"#AQA*#AQA*4WcWe0tQNQA*|3|1|
#127.0.0.1:8080|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*|1
"
);
ContextCarrier
contextCarrier
=
new
ContextCarrier
().
deserialize
(
"#AQA*#AQA*4WcWe0tQNQA*|3|1|
1|#127.0.0.1:8080|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*
"
);
assertTrue
(
contextCarrier
.
isValid
());
AbstractSpan
firstEntrySpan
=
ContextManager
.
createEntrySpan
(
"/testFirstEntry"
,
contextCarrier
);
...
...
apm-sniffer/apm-sdk-plugin/dubbo-plugin/src/test/java/org/skywalking/apm/plugin/dubbo/DubboInterceptorTest.java
浏览文件 @
e1d9701b
...
...
@@ -148,7 +148,7 @@ public class DubboInterceptorTest {
@Test
public
void
testProviderWithAttachment
()
throws
Throwable
{
when
(
rpcContext
.
isConsumerSide
()).
thenReturn
(
false
);
when
(
rpcContext
.
getAttachment
(
Config
.
Plugin
.
Propagation
.
HEADER_NAME
)).
thenReturn
(
"#AQA*#AQA*4WcWe0tQNQA*|3|1|
#192.168.1.8 :18002|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*|1
"
);
when
(
rpcContext
.
getAttachment
(
Config
.
Plugin
.
Propagation
.
HEADER_NAME
)).
thenReturn
(
"#AQA*#AQA*4WcWe0tQNQA*|3|1|
1|#192.168.1.8 :18002|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*
"
);
dubboInterceptor
.
beforeMethod
(
enhancedInstance
,
"invoke"
,
allArguments
,
argumentTypes
,
methodInterceptResult
);
dubboInterceptor
.
afterMethod
(
enhancedInstance
,
"invoke"
,
allArguments
,
argumentTypes
,
result
);
...
...
@@ -160,7 +160,7 @@ public class DubboInterceptorTest {
when
(
rpcContext
.
isConsumerSide
()).
thenReturn
(
false
);
FieldSetter
.
setStaticValue
(
BugFixActive
.
class
,
"ACTIVE"
,
true
);
testParam
.
setTraceContext
(
"#AQA*#AQA*4WcWe0tQNQA*|3|1|
#192.168.1.8 :18002|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*|1
"
);
testParam
.
setTraceContext
(
"#AQA*#AQA*4WcWe0tQNQA*|3|1|
1|#192.168.1.8 :18002|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*
"
);
dubboInterceptor
.
beforeMethod
(
enhancedInstance
,
"invoke"
,
allArguments
,
argumentTypes
,
methodInterceptResult
);
dubboInterceptor
.
afterMethod
(
enhancedInstance
,
"invoke"
,
allArguments
,
argumentTypes
,
result
);
...
...
apm-sniffer/apm-sdk-plugin/motan-plugin/src/test/java/org/skywalking/apm/plugin/motan/MotanProviderInterceptorTest.java
浏览文件 @
e1d9701b
...
...
@@ -91,7 +91,7 @@ public class MotanProviderInterceptorTest {
@Test
public
void
testInvokerWithRefSegment
()
throws
Throwable
{
HashMap
attachments
=
new
HashMap
();
attachments
.
put
(
Config
.
Plugin
.
Propagation
.
HEADER_NAME
,
"#AQA*#AQA*4WcWe0tQNQA*|3|1|
#192.168.1.8:18002|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*|1
"
);
attachments
.
put
(
Config
.
Plugin
.
Propagation
.
HEADER_NAME
,
"#AQA*#AQA*4WcWe0tQNQA*|3|1|
1|#192.168.1.8:18002|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*
"
);
when
(
request
.
getAttachments
()).
thenReturn
(
attachments
);
invokeInterceptor
.
beforeMethod
(
enhancedInstance
,
"execute"
,
arguments
,
argumentType
,
null
);
...
...
apm-sniffer/apm-sdk-plugin/resin-3.x-plugin/src/test/java/org/skywalking/apm/plugin/resin/v3/ResinV3InterceptorTest.java
浏览文件 @
e1d9701b
...
...
@@ -90,7 +90,7 @@ public class ResinV3InterceptorTest {
@Test
public
void
testWithSerializedContextData
()
throws
Throwable
{
when
(
request
.
getHeader
(
Config
.
Plugin
.
Propagation
.
HEADER_NAME
)).
thenReturn
(
"#AQA*#AQA*4WcWe0tQNQA*|3|1|
#192.168.1.8:18002|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*|1
"
);
when
(
request
.
getHeader
(
Config
.
Plugin
.
Propagation
.
HEADER_NAME
)).
thenReturn
(
"#AQA*#AQA*4WcWe0tQNQA*|3|1|
1|#192.168.1.8:18002|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*
"
);
interceptor
.
beforeMethod
(
enhancedInstance
,
"service"
,
arguments
,
argumentType
,
methodInterceptResult
);
interceptor
.
afterMethod
(
enhancedInstance
,
"service"
,
arguments
,
argumentType
,
null
);
...
...
apm-sniffer/apm-sdk-plugin/resin-4.x-plugin/src/test/java/org/skywalking/apm/plugin/resin/v4/ResinV4InterceptorTest.java
浏览文件 @
e1d9701b
...
...
@@ -92,7 +92,7 @@ public class ResinV4InterceptorTest {
@Test
public
void
testWithSerializedContextData
()
throws
Throwable
{
when
(
request
.
getHeader
(
Config
.
Plugin
.
Propagation
.
HEADER_NAME
)).
thenReturn
(
"#AQA*#AQA*4WcWe0tQNQA*|3|1|
#192.168.1.8:18002|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*|1
"
);
when
(
request
.
getHeader
(
Config
.
Plugin
.
Propagation
.
HEADER_NAME
)).
thenReturn
(
"#AQA*#AQA*4WcWe0tQNQA*|3|1|
1|#192.168.1.8:18002|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*
"
);
interceptor
.
beforeMethod
(
enhancedInstance
,
"service"
,
arguments
,
argumentType
,
methodInterceptResult
);
interceptor
.
afterMethod
(
enhancedInstance
,
"service"
,
arguments
,
argumentType
,
null
);
...
...
apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/test/java/org/skywalking/apm/plugin/tomcat78x/TomcatInterceptorTest.java
浏览文件 @
e1d9701b
...
...
@@ -82,7 +82,7 @@ public class TomcatInterceptorTest {
@Test
public
void
testWithSerializedContextData
()
throws
Throwable
{
when
(
request
.
getHeader
(
Config
.
Plugin
.
Propagation
.
HEADER_NAME
)).
thenReturn
(
"#AQA*#AQA*4WcWe0tQNQA*|3|1|
#192.168.1.8:18002|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*|1
"
);
when
(
request
.
getHeader
(
Config
.
Plugin
.
Propagation
.
HEADER_NAME
)).
thenReturn
(
"#AQA*#AQA*4WcWe0tQNQA*|3|1|
1|#192.168.1.8:18002|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*
"
);
tomcatInterceptor
.
beforeMethod
(
enhancedInstance
,
"invoke"
,
arguments
,
argumentType
,
methodInterceptResult
);
tomcatInterceptor
.
afterMethod
(
enhancedInstance
,
"invoke"
,
arguments
,
argumentType
,
null
);
...
...
apm-sniffer/apm-toolkit-activation/apm-toolkit-opentracing-activation/src/test/java/org/skywalking/apm/toolkit/activation/opentracing/SkywalkingSpanActivationTest.java
浏览文件 @
e1d9701b
...
...
@@ -183,7 +183,7 @@ public class SkywalkingSpanActivationTest {
.
withTag
(
Tags
.
PEER_HOST_IPV4
.
getKey
(),
"127.0.0.1"
).
withTag
(
Tags
.
PEER_PORT
.
getKey
(),
8080
);
startSpan
();
extractInterceptor
.
afterMethod
(
enhancedInstance
,
"extract"
,
new
Object
[]
{
"#AQA*#AQA*4WcWe0tQNQA*|3|1|
#127.0.0.1:8080|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*|1
"
},
new
Class
[]
{
String
.
class
},
null
);
new
Object
[]
{
"#AQA*#AQA*4WcWe0tQNQA*|3|1|
1|#127.0.0.1:8080|#/portal/|#/testEntrySpan|#AQA*#AQA*Et0We0tQNQA*
"
},
new
Class
[]
{
String
.
class
},
null
);
stopSpan
();
TraceSegment
tracingSegment
=
assertTraceSemgnets
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录