Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
润土的好友猹
SkyWalking
提交
686a8020
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,发现更多精彩内容 >>
提交
686a8020
编写于
7月 19, 2017
作者:
wu-sheng
提交者:
GitHub
7月 19, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into feature/jvm-shutdown-hook
上级
83b2b5f5
3fdc0181
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
38 addition
and
7 deletion
+38
-7
apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/ContextSnapshot.java
...rg/skywalking/apm/agent/core/context/ContextSnapshot.java
+17
-2
apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/IgnoredTracerContext.java
...ywalking/apm/agent/core/context/IgnoredTracerContext.java
+1
-1
apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/TracingContext.java
...org/skywalking/apm/agent/core/context/TracingContext.java
+14
-4
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
+6
-0
未找到文件。
apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/ContextSnapshot.java
浏览文件 @
686a8020
...
...
@@ -2,6 +2,8 @@ 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.dictionary.DictionaryUtil
;
import
org.skywalking.apm.util.StringUtil
;
/**
* The <code>ContextSnapshot</code> is a snapshot for current context. The snapshot carries the info for building
...
...
@@ -20,16 +22,24 @@ public class ContextSnapshot {
*/
private
int
spanId
=
-
1
;
private
String
entryOperationName
;
/**
* {@link DistributedTraceId}
*/
private
List
<
DistributedTraceId
>
distributedTraceIds
;
ContextSnapshot
(
String
traceSegmentId
,
int
spanId
,
List
<
DistributedTraceId
>
distributedTraceIds
)
{
List
<
DistributedTraceId
>
distributedTraceIds
,
int
entryServiceId
,
String
entryOperationName
)
{
this
.
traceSegmentId
=
traceSegmentId
;
this
.
spanId
=
spanId
;
this
.
distributedTraceIds
=
distributedTraceIds
;
if
(
entryServiceId
==
DictionaryUtil
.
nullValue
())
{
this
.
entryOperationName
=
"#"
+
entryOperationName
;
}
else
{
this
.
entryOperationName
=
String
.
valueOf
(
entryServiceId
);
}
}
public
List
<
DistributedTraceId
>
getDistributedTraceIds
()
{
...
...
@@ -48,6 +58,11 @@ public class ContextSnapshot {
return
traceSegmentId
!=
null
&&
spanId
>
-
1
&&
distributedTraceIds
!=
null
&&
distributedTraceIds
.
size
()
>
0
;
&&
distributedTraceIds
.
size
()
>
0
&&
!
StringUtil
.
isEmpty
(
entryOperationName
);
}
public
String
getEntryOperationName
()
{
return
entryOperationName
;
}
}
apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/IgnoredTracerContext.java
浏览文件 @
686a8020
...
...
@@ -33,7 +33,7 @@ public class IgnoredTracerContext implements AbstractTracerContext {
}
@Override
public
ContextSnapshot
capture
()
{
return
new
ContextSnapshot
(
null
,
-
1
,
null
);
return
new
ContextSnapshot
(
null
,
-
1
,
null
,
0
,
null
);
}
@Override
public
void
continued
(
ContextSnapshot
snapshot
)
{
...
...
apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/TracingContext.java
浏览文件 @
686a8020
...
...
@@ -132,10 +132,20 @@ public class TracingContext implements AbstractTracerContext {
*/
@Override
public
ContextSnapshot
capture
()
{
return
new
ContextSnapshot
(
segment
.
getTraceSegmentId
(),
activeSpan
().
getSpanId
(),
segment
.
getRelatedGlobalTraces
()
);
List
<
TraceSegmentRef
>
refs
=
this
.
segment
.
getRefs
();
if
(
refs
!=
null
&&
refs
.
size
()
>
0
)
{
TraceSegmentRef
ref
=
refs
.
get
(
0
);
return
new
ContextSnapshot
(
segment
.
getTraceSegmentId
(),
activeSpan
().
getSpanId
(),
segment
.
getRelatedGlobalTraces
(),
ref
.
getOperationId
(),
ref
.
getOperationName
()
);
}
else
{
AbstractTracingSpan
firstSpan
=
first
();
return
new
ContextSnapshot
(
segment
.
getTraceSegmentId
(),
activeSpan
().
getSpanId
(),
segment
.
getRelatedGlobalTraces
(),
firstSpan
.
getOperationId
(),
firstSpan
.
getOperationName
()
);
}
}
/**
...
...
apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/context/trace/TraceSegmentRef.java
浏览文件 @
686a8020
...
...
@@ -57,6 +57,12 @@ public class TraceSegmentRef {
this
.
type
=
SegmentRefType
.
CROSS_THREAD
;
this
.
traceSegmentId
=
snapshot
.
getTraceSegmentId
();
this
.
spanId
=
snapshot
.
getSpanId
();
String
entryOperationName
=
snapshot
.
getEntryOperationName
();
if
(
entryOperationName
.
charAt
(
0
)
==
'#'
)
{
this
.
operationName
=
entryOperationName
.
substring
(
1
);
}
else
{
this
.
operationId
=
Integer
.
parseInt
(
entryOperationName
);
}
}
public
String
getOperationName
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录