Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
月轩居士
SkyWalking
提交
88fbc6df
S
SkyWalking
项目概览
月轩居士
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
4
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,体验更适合开发者的 AI 搜索 >>
提交
88fbc6df
编写于
3月 24, 2017
作者:
P
pengys5
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove property layer and kind from node index
上级
2e396b21
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
32 deletion
+16
-32
skywalking-collector/skywalking-collector-worker/src/main/java/com/a/eye/skywalking/collector/worker/node/NodeIndex.java
...com/a/eye/skywalking/collector/worker/node/NodeIndex.java
+0
-10
skywalking-collector/skywalking-collector-worker/src/main/java/com/a/eye/skywalking/collector/worker/node/analysis/AbstractNodeAnalysis.java
.../collector/worker/node/analysis/AbstractNodeAnalysis.java
+8
-14
skywalking-collector/skywalking-collector-worker/src/main/java/com/a/eye/skywalking/collector/worker/node/persistence/NodeSearchWithTimeSlice.java
...ctor/worker/node/persistence/NodeSearchWithTimeSlice.java
+4
-4
skywalking-collector/skywalking-collector-worker/src/test/java/com/a/eye/skywalking/collector/worker/segment/SegmentPostTestCase.java
...walking/collector/worker/segment/SegmentPostTestCase.java
+4
-4
未找到文件。
skywalking-collector/skywalking-collector-worker/src/main/java/com/a/eye/skywalking/collector/worker/node/NodeIndex.java
浏览文件 @
88fbc6df
...
...
@@ -15,9 +15,7 @@ public class NodeIndex extends AbstractIndex {
public
static
final
String
Code
=
"code"
;
public
static
final
String
NickName
=
"nickName"
;
public
static
final
String
Layer
=
"layer"
;
public
static
final
String
Component
=
"component"
;
public
static
final
String
Kind
=
"kind"
;
@Override
public
String
index
()
{
...
...
@@ -42,18 +40,10 @@ public class NodeIndex extends AbstractIndex {
.
field
(
"type"
,
"string"
)
.
field
(
"index"
,
"not_analyzed"
)
.
endObject
()
.
startObject
(
Layer
)
.
field
(
"type"
,
"string"
)
.
field
(
"index"
,
"not_analyzed"
)
.
endObject
()
.
startObject
(
Component
)
.
field
(
"type"
,
"string"
)
.
field
(
"index"
,
"not_analyzed"
)
.
endObject
()
.
startObject
(
Kind
)
.
field
(
"type"
,
"string"
)
.
field
(
"index"
,
"not_analyzed"
)
.
endObject
()
.
startObject
(
AGG_COLUMN
)
.
field
(
"type"
,
"string"
)
.
field
(
"index"
,
"not_analyzed"
)
...
...
skywalking-collector/skywalking-collector-worker/src/main/java/com/a/eye/skywalking/collector/worker/node/analysis/AbstractNodeAnalysis.java
浏览文件 @
88fbc6df
...
...
@@ -35,14 +35,16 @@ abstract class AbstractNodeAnalysis extends RecordAnalysisMember {
if
(
CollectionTools
.
isNotEmpty
(
spanList
))
{
logger
.
debug
(
"node analysis span list size: %s"
,
spanList
.
size
());
String
id
=
timeSlice
+
Const
.
ID_SPLIT
+
segment
.
getApplicationCode
();
JsonObject
appDataJsonObj
=
new
JsonObject
();
appDataJsonObj
.
addProperty
(
NodeIndex
.
Code
,
segment
.
getApplicationCode
());
appDataJsonObj
.
addProperty
(
NodeIndex
.
NickName
,
segment
.
getApplicationCode
());
appDataJsonObj
.
addProperty
(
NodeIndex
.
Time_Slice
,
timeSlice
);
setRecord
(
id
,
appDataJsonObj
);
for
(
Span
span
:
spanList
)
{
JsonObject
dataJsonObj
=
new
JsonObject
();
String
kind
=
Tags
.
SPAN_KIND
.
get
(
span
);
dataJsonObj
.
addProperty
(
NodeIndex
.
Kind
,
kind
);
String
layer
=
Tags
.
SPAN_LAYER
.
get
(
span
);
dataJsonObj
.
addProperty
(
NodeIndex
.
Layer
,
layer
);
String
component
=
Tags
.
COMPONENT
.
get
(
span
);
dataJsonObj
.
addProperty
(
NodeIndex
.
Component
,
component
);
...
...
@@ -50,13 +52,7 @@ abstract class AbstractNodeAnalysis extends RecordAnalysisMember {
dataJsonObj
.
addProperty
(
NodeIndex
.
Code
,
code
);
dataJsonObj
.
addProperty
(
NodeIndex
.
Time_Slice
,
timeSlice
);
logger
.
debug
(
"span id=%s, kind=%s, layer=%s, component=%s, code=%s"
,
span
.
getSpanId
(),
kind
,
layer
,
component
,
code
);
String
id
=
timeSlice
+
Const
.
ID_SPLIT
+
code
;
logger
.
debug
(
"leaf client node: %s"
,
dataJsonObj
.
toString
());
dataJsonObj
.
addProperty
(
NodeIndex
.
Code
,
code
);
dataJsonObj
.
addProperty
(
NodeIndex
.
NickName
,
code
);
setRecord
(
id
,
dataJsonObj
);
logger
.
debug
(
"span id=%s, kind=%s, component=%s, code=%s"
,
span
.
getSpanId
(),
kind
,
component
,
code
);
if
(
Tags
.
SPAN_KIND_CLIENT
.
equals
(
kind
)
&&
ClientSpanIsLeafTools
.
isLeaf
(
span
.
getSpanId
(),
spanList
))
{
logger
.
debug
(
"The span id %s which kind is client and is a leaf span"
,
span
.
getSpanId
());
...
...
@@ -72,8 +68,6 @@ abstract class AbstractNodeAnalysis extends RecordAnalysisMember {
if
(
CollectionTools
.
isEmpty
(
segment
.
getRefs
()))
{
JsonObject
userDataJsonObj
=
new
JsonObject
();
userDataJsonObj
.
addProperty
(
NodeIndex
.
Code
,
Const
.
USER_CODE
);
userDataJsonObj
.
addProperty
(
NodeIndex
.
Layer
,
Const
.
USER_CODE
);
userDataJsonObj
.
addProperty
(
NodeIndex
.
Kind
,
Tags
.
SPAN_KIND_CLIENT
);
userDataJsonObj
.
addProperty
(
NodeIndex
.
Component
,
Const
.
USER_CODE
);
userDataJsonObj
.
addProperty
(
NodeIndex
.
NickName
,
Const
.
USER_CODE
);
userDataJsonObj
.
addProperty
(
NodeIndex
.
Time_Slice
,
timeSlice
);
...
...
skywalking-collector/skywalking-collector-worker/src/main/java/com/a/eye/skywalking/collector/worker/node/persistence/NodeSearchWithTimeSlice.java
浏览文件 @
88fbc6df
...
...
@@ -54,12 +54,12 @@ public class NodeSearchWithTimeSlice extends AbstractLocalSyncWorker {
TopHits
topHits
=
entry
.
getAggregations
().
get
(
NodeIndex
.
Top_One
);
for
(
SearchHit
hit
:
topHits
.
getHits
().
getHits
())
{
logger
.
debug
(
" -> id [{%s}], _source [{%s}]"
,
hit
.
getId
(),
hit
.
getSourceAsString
());
JsonObject
nodeObj
=
new
JsonObject
();
nodeObj
.
addProperty
(
NodeIndex
.
Code
,
(
String
)
hit
.
getSource
().
get
(
NodeIndex
.
Code
));
nodeObj
.
addProperty
(
NodeIndex
.
Component
,
(
String
)
hit
.
getSource
().
get
(
NodeIndex
.
Component
));
nodeObj
.
addProperty
(
NodeIndex
.
Layer
,
(
String
)
hit
.
getSource
().
get
(
NodeIndex
.
Layer
));
nodeObj
.
addProperty
(
NodeIndex
.
Kind
,
(
String
)
hit
.
getSource
().
get
(
NodeIndex
.
Kind
));
if
(
hit
.
getSource
().
containsKey
(
NodeIndex
.
Component
))
{
nodeObj
.
addProperty
(
NodeIndex
.
Component
,
(
String
)
hit
.
getSource
().
get
(
NodeIndex
.
Component
));
}
nodeObj
.
addProperty
(
NodeIndex
.
NickName
,
(
String
)
hit
.
getSource
().
get
(
NodeIndex
.
NickName
));
nodeObj
.
addProperty
(
NodeIndex
.
Time_Slice
,
(
Long
)
hit
.
getSource
().
get
(
NodeIndex
.
Time_Slice
));
nodeArray
.
add
(
nodeObj
);
...
...
skywalking-collector/skywalking-collector-worker/src/test/java/com/a/eye/skywalking/collector/worker/segment/SegmentPostTestCase.java
浏览文件 @
88fbc6df
...
...
@@ -100,10 +100,10 @@ public class SegmentPostTestCase {
// @Test
public
void
testPostSample1Segment
()
throws
Exception
{
// HttpClientTools.INSTANCE.post("http://localhost:7001/segment", sample1);
// HttpClientTools.INSTANCE.post("http://localhost:7001/segment", sample2);
// HttpClientTools.INSTANCE.post("http://localhost:7001/segment", sample3);
HttpClientTools
.
INSTANCE
.
post
(
"http://localhost:7001/segment"
,
test
);
// HttpClientTools.INSTANCE.post("http://localhost:7001/segment
s
", sample1);
// HttpClientTools.INSTANCE.post("http://localhost:7001/segment
s
", sample2);
// HttpClientTools.INSTANCE.post("http://localhost:7001/segment
s
", sample3);
HttpClientTools
.
INSTANCE
.
post
(
"http://localhost:7001/segment
s
"
,
test
);
}
private
String
test
=
"[{\"ts\":\"Segment.1490346133016.1756883859.5046.1.1\",\"st\":1490346133015,\"et\":1490346133041,\"ss\":[{\"si\":0,\"ps\":-1,\"st\":1490346133020,\"et\":1490346133041,\"on\":\"H2/JDBI/Statement/execute\",\"ts\":{\"db.instance\":\"dataSource\",\"span.layer\":\"db\",\"db.type\":\"sql\",\"component\":\"H2\",\"span.kind\":\"client\",\"db.statement\":\"CREATE TABLE CACHE_TABLE ( id INTEGER PRIMARY KEY AUTO_INCREMENT, CACHE_KEY VARCHAR(30), CACHE_VALUE VARCHAR(50) )\",\"peer.host\":\"localhost\"},\"tb\":{},\"ti\":{\"peer.port\":-1},\"lo\":[]}],\"ac\":\"cache-service\",\"gt\":[\"Trace.1490346133019.1756883859.5046.1.2\"],\"sampled\":true,\"minute\":201703241702,\"hour\":201703241700,\"day\":201703240000,\"aggId\":null}]"
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录