Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
润土的好友猹
SkyWalking
提交
da3d993e
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,体验更适合开发者的 AI 搜索 >>
提交
da3d993e
编写于
3月 04, 2018
作者:
P
peng-yongsheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add application node when the source of reference is not have application metric.
上级
c7dae338
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
134 addition
and
0 deletion
+134
-0
apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/service/SegmentBase64Printer.java
...segment/parser/provider/service/SegmentBase64Printer.java
+78
-0
apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/test/resources/log4j2.xml
...ser/segment-parser-provider/src/test/resources/log4j2.xml
+37
-0
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TopologyBuilder.java
.../skywalking/apm/collector/ui/service/TopologyBuilder.java
+19
-0
未找到文件。
apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/service/SegmentBase64Printer.java
0 → 100644
浏览文件 @
da3d993e
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.collector.analysis.segment.parser.provider.service
;
import
com.google.protobuf.InvalidProtocolBufferException
;
import
java.util.Base64
;
import
java.util.List
;
import
org.apache.skywalking.apm.network.proto.SpanObject
;
import
org.apache.skywalking.apm.network.proto.TraceSegmentObject
;
import
org.apache.skywalking.apm.network.proto.UniqueId
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* @author peng-yongsheng
*/
public
class
SegmentBase64Printer
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
SegmentBase64Printer
.
class
);
public
static
void
main
(
String
[]
args
)
throws
InvalidProtocolBufferException
{
String
segmentBase64
=
"CgwKCgIBsv/x1L2vgBsSggEQ////////////ARirnsP1niwg9Z7D9Z4sOhhIMi9KREJJL0Nvbm5lY3Rpb24vY2xvc2VKDGxvY2FsaG9zdDotMVABWAFgBHoOCgdkYi50eXBlEgNzcWx6GQoLZGIuaW5zdGFuY2USCmRhdGFTb3VyY2V6DgoMZGIuc3RhdGVtZW50GP///////////wEgAg=="
;
byte
[]
binarySegment
=
Base64
.
getDecoder
().
decode
(
segmentBase64
);
TraceSegmentObject
segmentObject
=
TraceSegmentObject
.
parseFrom
(
binarySegment
);
UniqueId
segmentId
=
segmentObject
.
getTraceSegmentId
();
StringBuilder
segmentIdBuilder
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
segmentId
.
getIdPartsList
().
size
();
i
++)
{
if
(
i
==
0
)
{
segmentIdBuilder
.
append
(
segmentId
.
getIdPartsList
().
get
(
i
));
}
else
{
segmentIdBuilder
.
append
(
"."
).
append
(
segmentId
.
getIdPartsList
().
get
(
i
));
}
}
LOGGER
.
info
(
"SegmentId: {}"
,
segmentIdBuilder
.
toString
());
LOGGER
.
info
(
"ApplicationId: {}"
,
segmentObject
.
getApplicationId
());
LOGGER
.
info
(
"ApplicationInstanceId: {}"
,
segmentObject
.
getApplicationInstanceId
());
List
<
SpanObject
>
spansList
=
segmentObject
.
getSpansList
();
LOGGER
.
info
(
"Spans:"
);
spansList
.
forEach
(
span
->
{
LOGGER
.
info
(
" Span:"
);
LOGGER
.
info
(
" SpanId: {}"
,
span
.
getSpanId
());
LOGGER
.
info
(
" ParentSpanId: {}"
,
span
.
getParentSpanId
());
LOGGER
.
info
(
" SpanLayer: {}"
,
span
.
getSpanLayer
());
LOGGER
.
info
(
" SpanType: {}"
,
span
.
getSpanType
());
LOGGER
.
info
(
" StartTime: {}"
,
span
.
getStartTime
());
LOGGER
.
info
(
" EndTime: {}"
,
span
.
getEndTime
());
LOGGER
.
info
(
" ComponentId: {}"
,
span
.
getComponentId
());
LOGGER
.
info
(
" Component: {}"
,
span
.
getComponent
());
LOGGER
.
info
(
" OperationNameId: {}"
,
span
.
getOperationNameId
());
LOGGER
.
info
(
" OperationName: {}"
,
span
.
getOperationName
());
LOGGER
.
info
(
" PeerId: {}"
,
span
.
getPeerId
());
LOGGER
.
info
(
" Peer: {}"
,
span
.
getPeer
());
LOGGER
.
info
(
" IsError: {}"
,
span
.
getIsError
());
LOGGER
.
info
(
" reference:"
);
span
.
getRefsList
().
forEach
(
reference
->
{
LOGGER
.
info
(
" EntryApplicationInstanceId: {}"
,
reference
.
getEntryApplicationInstanceId
());
});
});
}
}
apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/test/resources/log4j2.xml
0 → 100644
浏览文件 @
da3d993e
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<Configuration
status=
"info"
>
<Appenders>
<Console
name=
"Console"
target=
"SYSTEM_OUT"
>
<PatternLayout
charset=
"UTF-8"
pattern=
"%d - %c -%-4r [%t] %-5p %x - %m%n"
/>
</Console>
</Appenders>
<Loggers>
<logger
name=
"org.eclipse.jetty"
level=
"INFO"
/>
<logger
name=
"org.apache.zookeeper"
level=
"INFO"
/>
<logger
name=
"org.elasticsearch.common.network.IfConfig"
level=
"INFO"
/>
<logger
name=
"org.apache.skywalking.apm.collector.agent.grpc.provider.handler.JVMMetricsServiceHandler"
level=
"INFO"
/>
<logger
name=
"org.apache.skywalking.apm.collector.analysis.worker.timer.PersistenceTimer"
level=
"INFO"
/>
<logger
name=
"io.grpc.netty"
level=
"INFO"
/>
<Root
level=
"info"
>
<AppenderRef
ref=
"Console"
/>
</Root>
</Loggers>
</Configuration>
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TopologyBuilder.java
浏览文件 @
da3d993e
...
...
@@ -20,9 +20,11 @@ package org.apache.skywalking.apm.collector.ui.service;
import
java.text.ParseException
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
org.apache.skywalking.apm.collector.cache.CacheModule
;
import
org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
...
...
@@ -133,6 +135,17 @@ class TopologyBuilder {
nodes
.
add
(
conjecturalNode
);
}
Set
<
Integer
>
nodeIds
=
buildNodeIds
(
nodes
);
if
(!
nodeIds
.
contains
(
source
.
getApplicationId
()))
{
ApplicationNode
applicationNode
=
new
ApplicationNode
();
applicationNode
.
setId
(
source
.
getApplicationId
());
applicationNode
.
setName
(
source
.
getApplicationCode
());
applicationNode
.
setType
(
components
.
getOrDefault
(
source
.
getApplicationId
(),
Const
.
UNKNOWN
));
applicationNode
.
setApdex
(
100
);
applicationNode
.
setSla
(
100
);
nodes
.
add
(
applicationNode
);
}
Call
call
=
new
Call
();
call
.
setSource
(
source
.
getApplicationId
());
call
.
setSourceName
(
source
.
getApplicationCode
());
...
...
@@ -198,6 +211,12 @@ class TopologyBuilder {
return
topology
;
}
private
Set
<
Integer
>
buildNodeIds
(
List
<
Node
>
nodes
)
{
Set
<
Integer
>
nodeIds
=
new
HashSet
<>();
nodes
.
forEach
(
node
->
nodeIds
.
add
(
node
.
getId
()));
return
nodeIds
;
}
private
List
<
IApplicationReferenceMetricUIDAO
.
ApplicationReferenceMetric
>
calleeReferenceMetricFilter
(
List
<
IApplicationReferenceMetricUIDAO
.
ApplicationReferenceMetric
>
calleeReferenceMetric
)
{
List
<
IApplicationReferenceMetricUIDAO
.
ApplicationReferenceMetric
>
filteredMetrics
=
new
LinkedList
<>();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录