Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
月轩居士
SkyWalking
提交
bb1efe5d
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,发现更多精彩内容 >>
提交
bb1efe5d
编写于
5月 04, 2018
作者:
彭
彭勇升 pengys
提交者:
wu-sheng
5月 04, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Get conjectural node component name from component server name. (#1165)
上级
4fc5cc33
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
38 addition
and
51 deletion
+38
-51
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQuery.java
...e/skywalking/apm/collector/ui/query/ApplicationQuery.java
+6
-10
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/OverViewLayerQuery.java
...skywalking/apm/collector/ui/query/OverViewLayerQuery.java
+7
-18
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationTopologyService.java
.../apm/collector/ui/service/ApplicationTopologyService.java
+5
-15
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
+20
-8
未找到文件。
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQuery.java
浏览文件 @
bb1efe5d
...
...
@@ -18,21 +18,17 @@
package
org.apache.skywalking.apm.collector.ui.query
;
import
java.text.ParseException
;
import
java.util.List
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.storage.ui.application.Application
;
import
org.apache.skywalking.apm.collector.storage.ui.common.Duration
;
import
org.apache.skywalking.apm.collector.storage.ui.common.Topology
;
import
org.apache.skywalking.apm.collector.storage.ui.common.*
;
import
org.apache.skywalking.apm.collector.storage.ui.server.AppServerInfo
;
import
org.apache.skywalking.apm.collector.storage.ui.service.ServiceMetric
;
import
org.apache.skywalking.apm.collector.ui.graphql.Query
;
import
org.apache.skywalking.apm.collector.ui.service.ApplicationService
;
import
org.apache.skywalking.apm.collector.ui.service.ApplicationTopologyService
;
import
org.apache.skywalking.apm.collector.ui.service.ServerService
;
import
org.apache.skywalking.apm.collector.ui.service.*
;
import
org.apache.skywalking.apm.collector.ui.utils.DurationUtils
;
import
java.text.ParseException
;
import
java.util.List
;
import
static
java
.
util
.
Objects
.
isNull
;
/**
...
...
@@ -70,7 +66,7 @@ public class ApplicationQuery implements Query {
return
serverService
;
}
public
List
<
Application
>
getAllApplication
(
Duration
duration
)
throws
ParseException
{
public
List
<
Application
>
getAllApplication
(
Duration
duration
)
{
long
startSecondTimeBucket
=
DurationUtils
.
INSTANCE
.
startTimeDurationToSecondTimeBucket
(
duration
.
getStep
(),
duration
.
getStart
());
long
endSecondTimeBucket
=
DurationUtils
.
INSTANCE
.
endTimeDurationToSecondTimeBucket
(
duration
.
getStep
(),
duration
.
getEnd
());
...
...
@@ -88,7 +84,7 @@ public class ApplicationQuery implements Query {
}
public
List
<
ServiceMetric
>
getSlowService
(
int
applicationId
,
Duration
duration
,
Integer
topN
)
throws
ParseException
{
Integer
topN
)
{
long
startTimeBucket
=
DurationUtils
.
INSTANCE
.
exchangeToTimeBucket
(
duration
.
getStart
());
long
endTimeBucket
=
DurationUtils
.
INSTANCE
.
exchangeToTimeBucket
(
duration
.
getEnd
());
...
...
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/OverViewLayerQuery.java
浏览文件 @
bb1efe5d
...
...
@@ -21,22 +21,11 @@ package org.apache.skywalking.apm.collector.ui.query;
import
java.text.ParseException
;
import
java.util.List
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.storage.ui.common.Duration
;
import
org.apache.skywalking.apm.collector.storage.ui.common.Topology
;
import
org.apache.skywalking.apm.collector.storage.ui.common.ValueType
;
import
org.apache.skywalking.apm.collector.storage.ui.overview.AlarmTrend
;
import
org.apache.skywalking.apm.collector.storage.ui.overview.ApplicationThroughput
;
import
org.apache.skywalking.apm.collector.storage.ui.overview.ClusterBrief
;
import
org.apache.skywalking.apm.collector.storage.ui.overview.ConjecturalAppBrief
;
import
org.apache.skywalking.apm.collector.storage.ui.overview.Thermodynamic
;
import
org.apache.skywalking.apm.collector.storage.ui.common.*
;
import
org.apache.skywalking.apm.collector.storage.ui.overview.*
;
import
org.apache.skywalking.apm.collector.storage.ui.service.ServiceMetric
;
import
org.apache.skywalking.apm.collector.ui.graphql.Query
;
import
org.apache.skywalking.apm.collector.ui.service.AlarmService
;
import
org.apache.skywalking.apm.collector.ui.service.ApplicationService
;
import
org.apache.skywalking.apm.collector.ui.service.ClusterTopologyService
;
import
org.apache.skywalking.apm.collector.ui.service.NetworkAddressService
;
import
org.apache.skywalking.apm.collector.ui.service.ResponseTimeDistributionService
;
import
org.apache.skywalking.apm.collector.ui.service.ServiceNameService
;
import
org.apache.skywalking.apm.collector.ui.service.*
;
import
org.apache.skywalking.apm.collector.ui.utils.DurationUtils
;
import
static
java
.
util
.
Objects
.
isNull
;
...
...
@@ -100,7 +89,7 @@ public class OverViewLayerQuery implements Query {
return
timeDistributionService
;
}
public
Topology
getClusterTopology
(
Duration
duration
)
throws
ParseException
{
public
Topology
getClusterTopology
(
Duration
duration
)
{
long
startTimeBucket
=
DurationUtils
.
INSTANCE
.
exchangeToTimeBucket
(
duration
.
getStart
());
long
endTimeBucket
=
DurationUtils
.
INSTANCE
.
exchangeToTimeBucket
(
duration
.
getEnd
());
...
...
@@ -110,7 +99,7 @@ public class OverViewLayerQuery implements Query {
return
getClusterTopologyService
().
getClusterTopology
(
duration
.
getStep
(),
startTimeBucket
,
endTimeBucket
,
startSecondTimeBucket
,
endSecondTimeBucket
);
}
public
ClusterBrief
getClusterBrief
(
Duration
duration
)
throws
ParseException
{
public
ClusterBrief
getClusterBrief
(
Duration
duration
)
{
long
startSecondTimeBucket
=
DurationUtils
.
INSTANCE
.
startTimeDurationToSecondTimeBucket
(
duration
.
getStep
(),
duration
.
getStart
());
long
endSecondTimeBucket
=
DurationUtils
.
INSTANCE
.
endTimeDurationToSecondTimeBucket
(
duration
.
getStep
(),
duration
.
getEnd
());
...
...
@@ -133,14 +122,14 @@ public class OverViewLayerQuery implements Query {
return
getAlarmService
().
getApplicationAlarmTrend
(
duration
.
getStep
(),
startTimeBucket
,
endTimeBucket
,
startSecondTimeBucket
,
endSecondTimeBucket
);
}
public
ConjecturalAppBrief
getConjecturalApps
(
Duration
duration
)
throws
ParseException
{
public
ConjecturalAppBrief
getConjecturalApps
(
Duration
duration
)
{
long
startSecondTimeBucket
=
DurationUtils
.
INSTANCE
.
startTimeDurationToSecondTimeBucket
(
duration
.
getStep
(),
duration
.
getStart
());
long
endSecondTimeBucket
=
DurationUtils
.
INSTANCE
.
endTimeDurationToSecondTimeBucket
(
duration
.
getStep
(),
duration
.
getEnd
());
return
getApplicationService
().
getConjecturalApps
(
duration
.
getStep
(),
startSecondTimeBucket
,
endSecondTimeBucket
);
}
public
List
<
ServiceMetric
>
getTopNSlowService
(
Duration
duration
,
int
topN
)
throws
ParseException
{
public
List
<
ServiceMetric
>
getTopNSlowService
(
Duration
duration
,
int
topN
)
{
long
startTimeBucket
=
DurationUtils
.
INSTANCE
.
exchangeToTimeBucket
(
duration
.
getStart
());
long
endTimeBucket
=
DurationUtils
.
INSTANCE
.
exchangeToTimeBucket
(
duration
.
getEnd
());
...
...
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationTopologyService.java
浏览文件 @
bb1efe5d
...
...
@@ -18,25 +18,15 @@
package
org.apache.skywalking.apm.collector.ui.service
;
import
java.text.ParseException
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.*
;
import
org.apache.skywalking.apm.collector.configuration.ConfigurationModule
;
import
org.apache.skywalking.apm.collector.configuration.service.IComponentLibraryCatalogService
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.storage.StorageModule
;
import
org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationComponentUIDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMappingUIDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMetricUIDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationReferenceMetricUIDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.ui.*
;
import
org.apache.skywalking.apm.collector.storage.table.MetricSource
;
import
org.apache.skywalking.apm.collector.storage.ui.common.Step
;
import
org.apache.skywalking.apm.collector.storage.ui.common.Topology
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.apache.skywalking.apm.collector.storage.ui.common.*
;
import
org.slf4j.*
;
/**
* @author peng-yongsheng
...
...
@@ -62,7 +52,7 @@ public class ApplicationTopologyService {
}
public
Topology
getApplicationTopology
(
Step
step
,
int
applicationId
,
long
startTimeBucket
,
long
endTimeBucket
,
long
startSecondTimeBucket
,
long
endSecondTimeBucket
)
throws
ParseException
{
long
endTimeBucket
,
long
startSecondTimeBucket
,
long
endSecondTimeBucket
)
{
logger
.
debug
(
"startTimeBucket: {}, endTimeBucket: {}"
,
startTimeBucket
,
endTimeBucket
);
List
<
IApplicationComponentUIDAO
.
ApplicationComponent
>
applicationComponents
=
applicationComponentUIDAO
.
load
(
step
,
startTimeBucket
,
endTimeBucket
);
List
<
IApplicationMappingUIDAO
.
ApplicationMapping
>
applicationMappings
=
applicationMappingUIDAO
.
load
(
step
,
startTimeBucket
,
endTimeBucket
);
...
...
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TopologyBuilder.java
浏览文件 @
bb1efe5d
...
...
@@ -61,7 +61,8 @@ class TopologyBuilder {
List
<
IApplicationReferenceMetricUIDAO
.
ApplicationReferenceMetric
>
callerReferenceMetric
,
List
<
IApplicationReferenceMetricUIDAO
.
ApplicationReferenceMetric
>
calleeReferenceMetric
,
Step
step
,
long
startTimeBucket
,
long
endTimeBucket
,
long
startSecondTimeBucket
,
long
endSecondTimeBucket
)
{
Map
<
Integer
,
String
>
components
=
changeNodeComp2Map
(
applicationComponents
);
Map
<
Integer
,
String
>
nodeCompMap
=
buildNodeCompMap
(
applicationComponents
);
Map
<
Integer
,
String
>
conjecturalNodeCompMap
=
buildConjecturalNodeCompMap
(
applicationComponents
);
Map
<
Integer
,
Integer
>
mappings
=
changeMapping2Map
(
applicationMappings
);
filterZeroSourceOrTargetReference
(
callerReferenceMetric
);
...
...
@@ -76,7 +77,7 @@ class TopologyBuilder {
ApplicationNode
applicationNode
=
new
ApplicationNode
();
applicationNode
.
setId
(
applicationId
);
applicationNode
.
setName
(
application
.
getApplicationCode
());
applicationNode
.
setType
(
components
.
getOrDefault
(
application
.
getApplicationId
(),
Const
.
UNKNOWN
));
applicationNode
.
setType
(
nodeCompMap
.
getOrDefault
(
application
.
getApplicationId
(),
Const
.
UNKNOWN
));
applicationNode
.
setSla
(
SLACalculator
.
INSTANCE
.
calculate
(
applicationMetric
.
getErrorCalls
(),
applicationMetric
.
getCalls
()));
try
{
...
...
@@ -124,7 +125,7 @@ class TopologyBuilder {
ConjecturalNode
conjecturalNode
=
new
ConjecturalNode
();
conjecturalNode
.
setId
(
target
.
getApplicationId
());
conjecturalNode
.
setName
(
target
.
getApplicationCode
());
conjecturalNode
.
setType
(
co
mponents
.
getOrDefault
(
target
.
getApplicationId
(),
Const
.
UNKNOWN
));
conjecturalNode
.
setType
(
co
njecturalNodeCompMap
.
getOrDefault
(
target
.
getApplicationId
(),
Const
.
UNKNOWN
));
nodes
.
add
(
conjecturalNode
);
nodeIds
.
add
(
target
.
getApplicationId
());
}
...
...
@@ -135,7 +136,7 @@ class TopologyBuilder {
ApplicationNode
applicationNode
=
new
ApplicationNode
();
applicationNode
.
setId
(
source
.
getApplicationId
());
applicationNode
.
setName
(
source
.
getApplicationCode
());
applicationNode
.
setType
(
components
.
getOrDefault
(
source
.
getApplicationId
(),
Const
.
UNKNOWN
));
applicationNode
.
setType
(
nodeCompMap
.
getOrDefault
(
source
.
getApplicationId
(),
Const
.
UNKNOWN
));
applicationNode
.
setApdex
(
100
);
applicationNode
.
setSla
(
100
);
nodes
.
add
(
applicationNode
);
...
...
@@ -149,7 +150,7 @@ class TopologyBuilder {
call
.
setTarget
(
actualTargetId
);
call
.
setTargetName
(
applicationCacheService
.
getApplicationById
(
actualTargetId
).
getApplicationCode
());
call
.
setAlert
(
false
);
call
.
setCallType
(
components
.
get
(
referenceMetric
.
getTarget
()));
call
.
setCallType
(
nodeCompMap
.
get
(
referenceMetric
.
getTarget
()));
try
{
call
.
setCpm
(
referenceMetric
.
getCalls
()
/
dateBetweenService
.
minutesBetween
(
source
.
getApplicationId
(),
startSecondTimeBucket
,
endSecondTimeBucket
));
}
catch
(
ParseException
e
)
{
...
...
@@ -179,7 +180,7 @@ class TopologyBuilder {
ConjecturalNode
conjecturalNode
=
new
ConjecturalNode
();
conjecturalNode
.
setId
(
source
.
getApplicationId
());
conjecturalNode
.
setName
(
source
.
getApplicationCode
());
conjecturalNode
.
setType
(
co
mponents
.
getOrDefault
(
source
.
getApplicationId
(),
Const
.
UNKNOWN
));
conjecturalNode
.
setType
(
co
njecturalNodeCompMap
.
getOrDefault
(
target
.
getApplicationId
(),
Const
.
UNKNOWN
));
nodeIds
.
add
(
source
.
getApplicationId
());
nodes
.
add
(
conjecturalNode
);
}
...
...
@@ -195,7 +196,7 @@ class TopologyBuilder {
if
(
source
.
getApplicationId
()
==
Const
.
NONE_APPLICATION_ID
)
{
call
.
setCallType
(
Const
.
EMPTY_STRING
);
}
else
{
call
.
setCallType
(
components
.
get
(
referenceMetric
.
getTarget
()));
call
.
setCallType
(
nodeCompMap
.
get
(
referenceMetric
.
getTarget
()));
}
try
{
call
.
setCpm
(
referenceMetric
.
getCalls
()
/
dateBetweenService
.
minutesBetween
(
target
.
getApplicationId
(),
startSecondTimeBucket
,
endSecondTimeBucket
));
...
...
@@ -239,7 +240,18 @@ class TopologyBuilder {
return
mappings
;
}
private
Map
<
Integer
,
String
>
changeNodeComp2Map
(
private
Map
<
Integer
,
String
>
buildConjecturalNodeCompMap
(
List
<
IApplicationComponentUIDAO
.
ApplicationComponent
>
applicationComponents
)
{
Map
<
Integer
,
String
>
components
=
new
HashMap
<>();
applicationComponents
.
forEach
(
applicationComponent
->
{
int
componentServerId
=
this
.
componentLibraryCatalogService
.
getServerIdBasedOnComponent
(
applicationComponent
.
getComponentId
());
String
componentName
=
this
.
componentLibraryCatalogService
.
getServerName
(
componentServerId
);
components
.
put
(
applicationComponent
.
getApplicationId
(),
componentName
);
});
return
components
;
}
private
Map
<
Integer
,
String
>
buildNodeCompMap
(
List
<
IApplicationComponentUIDAO
.
ApplicationComponent
>
applicationComponents
)
{
Map
<
Integer
,
String
>
components
=
new
HashMap
<>();
applicationComponents
.
forEach
(
applicationComponent
->
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录