Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
killuaz丶x
SkyWalking
提交
fc5f67f0
S
SkyWalking
项目概览
killuaz丶x
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
1
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,发现更多精彩内容 >>
提交
fc5f67f0
编写于
3月 02, 2018
作者:
P
peng-yongsheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Setting the alarm attributes in topology.
上级
3863aa71
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
32 addition
and
8 deletion
+32
-8
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
+2
-2
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ClusterTopologyService.java
...king/apm/collector/ui/service/ClusterTopologyService.java
+1
-1
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServiceTopologyService.java
...king/apm/collector/ui/service/ServiceTopologyService.java
+1
-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
+28
-5
未找到文件。
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationTopologyService.java
浏览文件 @
fc5f67f0
...
@@ -60,7 +60,7 @@ public class ApplicationTopologyService {
...
@@ -60,7 +60,7 @@ public class ApplicationTopologyService {
public
Topology
getApplicationTopology
(
Step
step
,
int
applicationId
,
long
startTimeBucket
,
public
Topology
getApplicationTopology
(
Step
step
,
int
applicationId
,
long
startTimeBucket
,
long
endTimeBucket
,
long
startSecondTimeBucket
,
long
endSecondTimeBucket
)
throws
ParseException
{
long
endTimeBucket
,
long
startSecondTimeBucket
,
long
endSecondTimeBucket
)
throws
ParseException
{
logger
.
debug
(
"startTime
: {}, endTime
: {}"
,
startTimeBucket
,
endTimeBucket
);
logger
.
debug
(
"startTime
Bucket: {}, endTimeBucket
: {}"
,
startTimeBucket
,
endTimeBucket
);
List
<
IApplicationComponentUIDAO
.
ApplicationComponent
>
applicationComponents
=
applicationComponentUIDAO
.
load
(
step
,
startTimeBucket
,
endTimeBucket
);
List
<
IApplicationComponentUIDAO
.
ApplicationComponent
>
applicationComponents
=
applicationComponentUIDAO
.
load
(
step
,
startTimeBucket
,
endTimeBucket
);
List
<
IApplicationMappingUIDAO
.
ApplicationMapping
>
applicationMappings
=
applicationMappingUIDAO
.
load
(
step
,
startTimeBucket
,
endTimeBucket
);
List
<
IApplicationMappingUIDAO
.
ApplicationMapping
>
applicationMappings
=
applicationMappingUIDAO
.
load
(
step
,
startTimeBucket
,
endTimeBucket
);
...
@@ -82,6 +82,6 @@ public class ApplicationTopologyService {
...
@@ -82,6 +82,6 @@ public class ApplicationTopologyService {
TopologyBuilder
builder
=
new
TopologyBuilder
(
moduleManager
);
TopologyBuilder
builder
=
new
TopologyBuilder
(
moduleManager
);
return
builder
.
build
(
applicationComponents
,
applicationMappings
,
applicationMetrics
,
callerReferenceMetric
,
calleeReferenceMetric
,
startSecondTimeBucket
,
endSecondTimeBucket
);
return
builder
.
build
(
applicationComponents
,
applicationMappings
,
applicationMetrics
,
callerReferenceMetric
,
calleeReferenceMetric
,
start
TimeBucket
,
endTimeBucket
,
start
SecondTimeBucket
,
endSecondTimeBucket
);
}
}
}
}
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ClusterTopologyService.java
浏览文件 @
fc5f67f0
...
@@ -72,6 +72,6 @@ public class ClusterTopologyService {
...
@@ -72,6 +72,6 @@ public class ClusterTopologyService {
TopologyBuilder
builder
=
new
TopologyBuilder
(
moduleManager
);
TopologyBuilder
builder
=
new
TopologyBuilder
(
moduleManager
);
return
builder
.
build
(
applicationComponents
,
applicationMappings
,
applicationMetrics
,
callerReferenceMetric
,
calleeReferenceMetric
,
startSecondTimeBucket
,
endSecondTimeBucket
);
return
builder
.
build
(
applicationComponents
,
applicationMappings
,
applicationMetrics
,
callerReferenceMetric
,
calleeReferenceMetric
,
start
TimeBucket
,
endTimeBucket
,
start
SecondTimeBucket
,
endSecondTimeBucket
);
}
}
}
}
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServiceTopologyService.java
浏览文件 @
fc5f67f0
...
@@ -94,6 +94,7 @@ public class ServiceTopologyService {
...
@@ -94,6 +94,7 @@ public class ServiceTopologyService {
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
logger
.
error
(
e
.
getMessage
(),
e
);
}
}
call
.
setAlert
(
false
);
calls
.
add
(
call
);
calls
.
add
(
call
);
});
});
...
...
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TopologyBuilder.java
浏览文件 @
fc5f67f0
...
@@ -33,6 +33,7 @@ import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMappingUID
...
@@ -33,6 +33,7 @@ import org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMappingUID
import
org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMetricUIDAO
;
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.IApplicationReferenceMetricUIDAO
;
import
org.apache.skywalking.apm.collector.storage.table.register.Application
;
import
org.apache.skywalking.apm.collector.storage.table.register.Application
;
import
org.apache.skywalking.apm.collector.storage.ui.alarm.Alarm
;
import
org.apache.skywalking.apm.collector.storage.ui.application.ApplicationNode
;
import
org.apache.skywalking.apm.collector.storage.ui.application.ApplicationNode
;
import
org.apache.skywalking.apm.collector.storage.ui.application.ConjecturalNode
;
import
org.apache.skywalking.apm.collector.storage.ui.application.ConjecturalNode
;
import
org.apache.skywalking.apm.collector.storage.ui.common.Call
;
import
org.apache.skywalking.apm.collector.storage.ui.common.Call
;
...
@@ -55,11 +56,13 @@ class TopologyBuilder {
...
@@ -55,11 +56,13 @@ class TopologyBuilder {
private
final
ApplicationCacheService
applicationCacheService
;
private
final
ApplicationCacheService
applicationCacheService
;
private
final
ServerService
serverService
;
private
final
ServerService
serverService
;
private
final
SecondBetweenService
secondBetweenService
;
private
final
SecondBetweenService
secondBetweenService
;
private
final
AlarmService
alarmService
;
TopologyBuilder
(
ModuleManager
moduleManager
)
{
TopologyBuilder
(
ModuleManager
moduleManager
)
{
this
.
applicationCacheService
=
moduleManager
.
find
(
CacheModule
.
NAME
).
getService
(
ApplicationCacheService
.
class
);
this
.
applicationCacheService
=
moduleManager
.
find
(
CacheModule
.
NAME
).
getService
(
ApplicationCacheService
.
class
);
this
.
serverService
=
new
ServerService
(
moduleManager
);
this
.
serverService
=
new
ServerService
(
moduleManager
);
this
.
secondBetweenService
=
new
SecondBetweenService
(
moduleManager
);
this
.
secondBetweenService
=
new
SecondBetweenService
(
moduleManager
);
this
.
alarmService
=
new
AlarmService
(
moduleManager
);
}
}
Topology
build
(
List
<
IApplicationComponentUIDAO
.
ApplicationComponent
>
applicationComponents
,
Topology
build
(
List
<
IApplicationComponentUIDAO
.
ApplicationComponent
>
applicationComponents
,
...
@@ -67,7 +70,7 @@ class TopologyBuilder {
...
@@ -67,7 +70,7 @@ class TopologyBuilder {
List
<
IApplicationMetricUIDAO
.
ApplicationMetric
>
applicationMetrics
,
List
<
IApplicationMetricUIDAO
.
ApplicationMetric
>
applicationMetrics
,
List
<
IApplicationReferenceMetricUIDAO
.
ApplicationReferenceMetric
>
callerReferenceMetric
,
List
<
IApplicationReferenceMetricUIDAO
.
ApplicationReferenceMetric
>
callerReferenceMetric
,
List
<
IApplicationReferenceMetricUIDAO
.
ApplicationReferenceMetric
>
calleeReferenceMetric
,
List
<
IApplicationReferenceMetricUIDAO
.
ApplicationReferenceMetric
>
calleeReferenceMetric
,
long
startSecondTimeBucket
,
long
endSecondTimeBucket
)
{
long
start
TimeBucket
,
long
endTimeBucket
,
long
start
SecondTimeBucket
,
long
endSecondTimeBucket
)
{
Map
<
Integer
,
String
>
components
=
changeNodeComp2Map
(
applicationComponents
);
Map
<
Integer
,
String
>
components
=
changeNodeComp2Map
(
applicationComponents
);
Map
<
Integer
,
Integer
>
mappings
=
changeMapping2Map
(
applicationMappings
);
Map
<
Integer
,
Integer
>
mappings
=
changeMapping2Map
(
applicationMappings
);
...
@@ -91,9 +94,29 @@ class TopologyBuilder {
...
@@ -91,9 +94,29 @@ class TopologyBuilder {
applicationNode
.
setAvgResponseTime
((
applicationMetric
.
getDurations
()
-
applicationMetric
.
getErrorDurations
())
/
(
applicationMetric
.
getCalls
()
-
applicationMetric
.
getErrorCalls
()));
applicationNode
.
setAvgResponseTime
((
applicationMetric
.
getDurations
()
-
applicationMetric
.
getErrorDurations
())
/
(
applicationMetric
.
getCalls
()
-
applicationMetric
.
getErrorCalls
()));
applicationNode
.
setApdex
(
ApdexCalculator
.
INSTANCE
.
calculate
(
applicationMetric
.
getSatisfiedCount
(),
applicationMetric
.
getToleratingCount
(),
applicationMetric
.
getFrustratedCount
()));
applicationNode
.
setApdex
(
ApdexCalculator
.
INSTANCE
.
calculate
(
applicationMetric
.
getSatisfiedCount
(),
applicationMetric
.
getToleratingCount
(),
applicationMetric
.
getFrustratedCount
()));
applicationNode
.
setAlarm
(
false
);
applicationNode
.
setAlarm
(
false
);
try
{
Alarm
alarm
=
alarmService
.
loadApplicationAlarmList
(
Const
.
EMPTY_STRING
,
startTimeBucket
,
endTimeBucket
,
1
,
0
);
if
(
alarm
.
getItems
().
size
()
>
0
)
{
applicationNode
.
setAlarm
(
true
);
}
}
catch
(
ParseException
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
}
applicationNode
.
setNumOfServer
(
serverService
.
getAllServer
(
applicationId
,
startSecondTimeBucket
,
endSecondTimeBucket
).
size
());
applicationNode
.
setNumOfServer
(
serverService
.
getAllServer
(
applicationId
,
startSecondTimeBucket
,
endSecondTimeBucket
).
size
());
applicationNode
.
setNumOfServerAlarm
(
1
);
try
{
applicationNode
.
setNumOfServiceAlarm
(
1
);
Alarm
alarm
=
alarmService
.
loadInstanceAlarmList
(
Const
.
EMPTY_STRING
,
startTimeBucket
,
endTimeBucket
,
1000
,
0
);
applicationNode
.
setNumOfServerAlarm
(
alarm
.
getItems
().
size
());
}
catch
(
ParseException
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
}
try
{
Alarm
alarm
=
alarmService
.
loadServiceAlarmList
(
Const
.
EMPTY_STRING
,
startTimeBucket
,
endTimeBucket
,
1000
,
0
);
applicationNode
.
setNumOfServiceAlarm
(
alarm
.
getItems
().
size
());
}
catch
(
ParseException
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
}
nodes
.
add
(
applicationNode
);
nodes
.
add
(
applicationNode
);
});
});
...
@@ -117,7 +140,7 @@ class TopologyBuilder {
...
@@ -117,7 +140,7 @@ class TopologyBuilder {
int
actualTargetId
=
mappings
.
getOrDefault
(
target
.
getApplicationId
(),
target
.
getApplicationId
());
int
actualTargetId
=
mappings
.
getOrDefault
(
target
.
getApplicationId
(),
target
.
getApplicationId
());
call
.
setTarget
(
actualTargetId
);
call
.
setTarget
(
actualTargetId
);
call
.
setTargetName
(
applicationCacheService
.
getApplicationById
(
actualTargetId
).
getApplicationCode
());
call
.
setTargetName
(
applicationCacheService
.
getApplicationById
(
actualTargetId
).
getApplicationCode
());
call
.
setAlert
(
tru
e
);
call
.
setAlert
(
fals
e
);
call
.
setCallType
(
components
.
get
(
referenceMetric
.
getTarget
()));
call
.
setCallType
(
components
.
get
(
referenceMetric
.
getTarget
()));
try
{
try
{
call
.
setCallsPerSec
(
referenceMetric
.
getCalls
()
/
secondBetweenService
.
calculate
(
source
.
getApplicationId
(),
startSecondTimeBucket
,
endSecondTimeBucket
));
call
.
setCallsPerSec
(
referenceMetric
.
getCalls
()
/
secondBetweenService
.
calculate
(
source
.
getApplicationId
(),
startSecondTimeBucket
,
endSecondTimeBucket
));
...
@@ -153,7 +176,7 @@ class TopologyBuilder {
...
@@ -153,7 +176,7 @@ class TopologyBuilder {
call
.
setSourceName
(
source
.
getApplicationCode
());
call
.
setSourceName
(
source
.
getApplicationCode
());
call
.
setTarget
(
target
.
getApplicationId
());
call
.
setTarget
(
target
.
getApplicationId
());
call
.
setTargetName
(
target
.
getApplicationCode
());
call
.
setTargetName
(
target
.
getApplicationCode
());
call
.
setAlert
(
tru
e
);
call
.
setAlert
(
fals
e
);
if
(
source
.
getApplicationId
()
==
Const
.
NONE_APPLICATION_ID
)
{
if
(
source
.
getApplicationId
()
==
Const
.
NONE_APPLICATION_ID
)
{
call
.
setCallType
(
Const
.
EMPTY_STRING
);
call
.
setCallType
(
Const
.
EMPTY_STRING
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录