Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
killuaz丶x
SkyWalking
提交
bdc0601c
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,发现更多精彩内容 >>
提交
bdc0601c
编写于
3月 03, 2018
作者:
P
peng-yongsheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed the call type in calls of topology.
上级
41840ce8
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
71 addition
and
55 deletion
+71
-55
apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/SpanIdExchanger.java
...rser/provider/parser/standardization/SpanIdExchanger.java
+1
-1
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/ServerType.java
...king/apm/collector/storage/table/register/ServerType.java
+7
-7
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/ServerTypeDefine.java
...pm/collector/storage/table/register/ServerTypeDefine.java
+41
-37
apm-collector/apm-collector-storage/collector-storage-define/src/test/java/org/apache/skywalking/apm/collector/storage/table/register/ServerTypeDefineTestCase.java
...ctor/storage/table/register/ServerTypeDefineTestCase.java
+1
-1
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationService.java
...ywalking/apm/collector/ui/service/ApplicationService.java
+3
-2
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
+18
-7
未找到文件。
apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/segment/parser/provider/parser/standardization/SpanIdExchanger.java
浏览文件 @
bdc0601c
...
@@ -65,7 +65,7 @@ public class SpanIdExchanger implements IdExchanger<SpanDecorator> {
...
@@ -65,7 +65,7 @@ public class SpanIdExchanger implements IdExchanger<SpanDecorator> {
standardBuilder
.
setPeer
(
Const
.
EMPTY_STRING
);
standardBuilder
.
setPeer
(
Const
.
EMPTY_STRING
);
int
spanLayer
=
standardBuilder
.
getSpanLayerValue
();
int
spanLayer
=
standardBuilder
.
getSpanLayerValue
();
int
serverType
=
ServerTypeDefine
.
getInstance
().
getServerType
Id
(
standardBuilder
.
getComponentId
()
);
int
serverType
=
ServerTypeDefine
.
getInstance
().
getServerType
ByComponentId
(
standardBuilder
.
getComponentId
()).
getId
(
);
networkAddressIDService
.
update
(
peerId
,
spanLayer
,
serverType
);
networkAddressIDService
.
update
(
peerId
,
spanLayer
,
serverType
);
}
}
}
}
...
...
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/ServerType.java
浏览文件 @
bdc0601c
...
@@ -22,25 +22,25 @@ package org.apache.skywalking.apm.collector.storage.table.register;
...
@@ -22,25 +22,25 @@ package org.apache.skywalking.apm.collector.storage.table.register;
* @author peng-yongsheng
* @author peng-yongsheng
*/
*/
public
class
ServerType
{
public
class
ServerType
{
private
int
componentId
;
private
int
id
;
private
int
id
;
private
int
componentId
;
private
String
name
;
private
String
name
;
public
ServerType
(
int
componentId
,
int
id
,
String
name
)
{
public
ServerType
(
int
id
,
String
name
)
{
this
.
componentId
=
componentId
;
this
.
id
=
id
;
this
.
id
=
id
;
this
.
name
=
name
;
this
.
name
=
name
;
this
.
componentId
=
id
;
}
}
public
int
getId
()
{
public
int
getId
()
{
return
id
;
return
id
;
}
}
public
String
getName
()
{
return
name
;
}
public
int
getComponentId
()
{
public
int
getComponentId
()
{
return
componentId
;
return
componentId
;
}
}
public
String
getName
()
{
return
name
;
}
}
}
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/ServerTypeDefine.java
浏览文件 @
bdc0601c
...
@@ -28,41 +28,46 @@ public class ServerTypeDefine {
...
@@ -28,41 +28,46 @@ public class ServerTypeDefine {
private
static
ServerTypeDefine
INSTANCE
=
new
ServerTypeDefine
();
private
static
ServerTypeDefine
INSTANCE
=
new
ServerTypeDefine
();
private
String
[]
serverTypeNames
;
private
ServerType
[]
serverTypes
;
private
ServerType
[]
serverTypes
;
private
static
final
String
HTTP
=
"http"
;
private
static
final
String
GRPC
=
"gRPC"
;
private
static
final
String
DUBBO
=
"dubbo"
;
private
static
final
String
MOTAN
=
"motan"
;
private
static
final
String
CLIENT
=
"client"
;
private
static
final
String
JDBC_DRIVER
=
"JDBC driver"
;
private
ServerTypeDefine
()
{
private
ServerTypeDefine
()
{
this
.
serverTypes
=
new
ServerType
[
30
];
this
.
serverTypes
=
new
ServerType
[
30
];
this
.
serverTypeNames
=
new
String
[
11
];
addServerType
(
new
ServerType
(
ComponentsDefine
.
TOMCAT
.
getId
(),
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
TOMCAT
.
getId
(),
Const
.
NONE
,
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
HTTPCLIENT
.
getId
(),
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
HTTPCLIENT
.
getId
(),
Const
.
NONE
,
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
DUBBO
.
getId
(),
DUBBO
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
DUBBO
.
getId
(),
Const
.
NONE
,
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
H2
.
getId
(),
JDBC_DRIVER
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
H2
.
getId
(),
1
,
ComponentsDefine
.
H2
.
getName
()));
addServerType
(
new
ServerType
(
ComponentsDefine
.
MYSQL
.
getId
(),
JDBC_DRIVER
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
MYSQL
.
getId
(),
2
,
ComponentsDefine
.
MYSQL
.
getName
()));
addServerType
(
new
ServerType
(
ComponentsDefine
.
ORACLE
.
getId
(),
JDBC_DRIVER
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
ORACLE
.
getId
(),
3
,
ComponentsDefine
.
ORACLE
.
getName
()));
addServerType
(
new
ServerType
(
ComponentsDefine
.
REDIS
.
getId
(),
CLIENT
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
REDIS
.
getId
(),
4
,
ComponentsDefine
.
REDIS
.
getName
()));
addServerType
(
new
ServerType
(
ComponentsDefine
.
MOTAN
.
getId
(),
MOTAN
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
MOTAN
.
getId
(),
Const
.
NONE
,
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
MONGODB
.
getId
(),
CLIENT
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
MONGODB
.
getId
(),
5
,
ComponentsDefine
.
MONGODB
.
getName
()));
addServerType
(
new
ServerType
(
ComponentsDefine
.
RESIN
.
getId
(),
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
RESIN
.
getId
(),
Const
.
NONE
,
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
FEIGN
.
getId
(),
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
FEIGN
.
getId
(),
Const
.
NONE
,
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
OKHTTP
.
getId
(),
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
OKHTTP
.
getId
(),
Const
.
NONE
,
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
SPRING_REST_TEMPLATE
.
getId
(),
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
SPRING_REST_TEMPLATE
.
getId
(),
Const
.
NONE
,
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
SPRING_MVC_ANNOTATION
.
getId
(),
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
SPRING_MVC_ANNOTATION
.
getId
(),
Const
.
NONE
,
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
STRUTS2
.
getId
(),
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
STRUTS2
.
getId
(),
Const
.
NONE
,
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
NUTZ_MVC_ANNOTATION
.
getId
(),
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
NUTZ_MVC_ANNOTATION
.
getId
(),
Const
.
NONE
,
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
NUTZ_HTTP
.
getId
(),
HTTP
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
NUTZ_HTTP
.
getId
(),
Const
.
NONE
,
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
JETTY_CLIENT
.
getId
(),
HTTP
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
JETTY_CLIENT
.
getId
(),
Const
.
NONE
,
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
JETTY_SERVER
.
getId
(),
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
JETTY_SERVER
.
getId
(),
Const
.
NONE
,
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
MEMCACHED
.
getId
(),
CLIENT
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
MEMCACHED
.
getId
(),
6
,
ComponentsDefine
.
MEMCACHED
.
getName
()));
addServerType
(
new
ServerType
(
ComponentsDefine
.
SHARDING_JDBC
.
getId
(),
JDBC_DRIVER
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
SHARDING_JDBC
.
getId
(),
7
,
ComponentsDefine
.
SHARDING_JDBC
.
getName
()));
addServerType
(
new
ServerType
(
ComponentsDefine
.
POSTGRESQL
.
getId
(),
JDBC_DRIVER
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
POSTGRESQL
.
getId
(),
8
,
ComponentsDefine
.
POSTGRESQL
.
getName
()));
addServerType
(
new
ServerType
(
ComponentsDefine
.
GRPC
.
getId
(),
GRPC
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
GRPC
.
getId
(),
Const
.
NONE
,
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
ELASTIC_JOB
.
getId
(),
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
ELASTIC_JOB
.
getId
(),
Const
.
NONE
,
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
ROCKET_MQ
.
getId
(),
CLIENT
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
ROCKET_MQ
.
getId
(),
9
,
ComponentsDefine
.
ROCKET_MQ
.
getName
()));
addServerType
(
new
ServerType
(
ComponentsDefine
.
HTTP_ASYNC_CLIENT
.
getId
(),
HTTP
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
HTTP_ASYNC_CLIENT
.
getId
(),
Const
.
NONE
,
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
KAFKA
.
getId
(),
CLIENT
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
KAFKA
.
getId
(),
10
,
ComponentsDefine
.
KAFKA
.
getName
()));
addServerType
(
new
ServerType
(
ComponentsDefine
.
SERVICECOMB
.
getId
(),
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
SERVICECOMB
.
getId
(),
Const
.
NONE
,
ComponentsDefine
.
SERVICECOMB
.
getName
()));
addServerType
(
new
ServerType
(
ComponentsDefine
.
HYSTRIX
.
getId
(),
Const
.
EMPTY_STRING
));
addServerType
(
new
ServerType
(
ComponentsDefine
.
HYSTRIX
.
getId
(),
Const
.
NONE
,
ComponentsDefine
.
HYSTRIX
.
getName
()));
}
}
public
static
ServerTypeDefine
getInstance
()
{
public
static
ServerTypeDefine
getInstance
()
{
...
@@ -70,15 +75,14 @@ public class ServerTypeDefine {
...
@@ -70,15 +75,14 @@ public class ServerTypeDefine {
}
}
private
void
addServerType
(
ServerType
serverType
)
{
private
void
addServerType
(
ServerType
serverType
)
{
serverTypeNames
[
serverType
.
getId
()]
=
serverType
.
getName
();
serverTypes
[
serverType
.
getId
()]
=
serverType
;
serverTypes
[
serverType
.
getComponentId
()]
=
serverType
;
}
}
public
int
getServerType
Id
(
int
componentId
)
{
public
ServerType
getServerTypeByComponent
Id
(
int
componentId
)
{
return
serverTypes
[
componentId
]
.
getId
()
;
return
serverTypes
[
componentId
];
}
}
public
S
tring
getServerType
(
int
serverTypeId
)
{
public
S
erverType
getServerType
(
int
serverTypeId
)
{
return
serverType
Name
s
[
serverTypeId
];
return
serverTypes
[
serverTypeId
];
}
}
}
}
apm-collector/apm-collector-storage/collector-storage-define/src/test/java/org/apache/skywalking/apm/collector/storage/table/register/ServerTypeDefineTestCase.java
浏览文件 @
bdc0601c
...
@@ -35,7 +35,7 @@ public class ServerTypeDefineTestCase {
...
@@ -35,7 +35,7 @@ public class ServerTypeDefineTestCase {
for
(
Field
field
:
fields
)
{
for
(
Field
field
:
fields
)
{
if
(
field
.
getType
().
equals
(
OfficialComponent
.
class
))
{
if
(
field
.
getType
().
equals
(
OfficialComponent
.
class
))
{
OfficialComponent
component
=
(
OfficialComponent
)
field
.
get
(
ComponentsDefine
.
getInstance
());
OfficialComponent
component
=
(
OfficialComponent
)
field
.
get
(
ComponentsDefine
.
getInstance
());
ServerTypeDefine
.
getInstance
().
getServerTypeId
(
component
.
getId
());
ServerTypeDefine
.
getInstance
().
getServerType
ByComponent
Id
(
component
.
getId
());
}
}
}
}
}
}
...
...
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationService.java
浏览文件 @
bdc0601c
...
@@ -40,6 +40,7 @@ import org.apache.skywalking.apm.collector.storage.ui.overview.ConjecturalApp;
...
@@ -40,6 +40,7 @@ import org.apache.skywalking.apm.collector.storage.ui.overview.ConjecturalApp;
import
org.apache.skywalking.apm.collector.storage.ui.overview.ConjecturalAppBrief
;
import
org.apache.skywalking.apm.collector.storage.ui.overview.ConjecturalAppBrief
;
import
org.apache.skywalking.apm.collector.storage.ui.service.ServiceMetric
;
import
org.apache.skywalking.apm.collector.storage.ui.service.ServiceMetric
;
import
org.apache.skywalking.apm.collector.ui.utils.DurationUtils
;
import
org.apache.skywalking.apm.collector.ui.utils.DurationUtils
;
import
org.apache.skywalking.apm.network.trace.component.ComponentsDefine
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -117,8 +118,8 @@ public class ApplicationService {
...
@@ -117,8 +118,8 @@ public class ApplicationService {
long
endSecondTimeBucket
)
throws
ParseException
{
long
endSecondTimeBucket
)
throws
ParseException
{
List
<
ConjecturalApp
>
conjecturalApps
=
networkAddressUIDAO
.
getConjecturalApps
();
List
<
ConjecturalApp
>
conjecturalApps
=
networkAddressUIDAO
.
getConjecturalApps
();
conjecturalApps
.
forEach
(
conjecturalApp
->
{
conjecturalApps
.
forEach
(
conjecturalApp
->
{
String
name
=
ServerTypeDefine
.
getInstance
().
getServerType
(
conjecturalApp
.
getId
()
);
int
componentId
=
ServerTypeDefine
.
getInstance
().
getServerType
(
conjecturalApp
.
getId
()).
getComponentId
(
);
conjecturalApp
.
setName
(
name
);
conjecturalApp
.
setName
(
ComponentsDefine
.
getInstance
().
getComponentName
(
componentId
)
);
});
});
ConjecturalAppBrief
conjecturalAppBrief
=
new
ConjecturalAppBrief
();
ConjecturalAppBrief
conjecturalAppBrief
=
new
ConjecturalAppBrief
();
...
...
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TopologyBuilder.java
浏览文件 @
bdc0601c
...
@@ -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.table.register.ServerTypeDefine
;
import
org.apache.skywalking.apm.collector.storage.ui.alarm.Alarm
;
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
;
...
@@ -71,7 +72,8 @@ class TopologyBuilder {
...
@@ -71,7 +72,8 @@ class TopologyBuilder {
List
<
IApplicationReferenceMetricUIDAO
.
ApplicationReferenceMetric
>
callerReferenceMetric
,
List
<
IApplicationReferenceMetricUIDAO
.
ApplicationReferenceMetric
>
callerReferenceMetric
,
List
<
IApplicationReferenceMetricUIDAO
.
ApplicationReferenceMetric
>
calleeReferenceMetric
,
List
<
IApplicationReferenceMetricUIDAO
.
ApplicationReferenceMetric
>
calleeReferenceMetric
,
long
startTimeBucket
,
long
endTimeBucket
,
long
startSecondTimeBucket
,
long
endSecondTimeBucket
)
{
long
startTimeBucket
,
long
endTimeBucket
,
long
startSecondTimeBucket
,
long
endSecondTimeBucket
)
{
Map
<
Integer
,
String
>
components
=
changeNodeComp2Map
(
applicationComponents
);
Map
<
Integer
,
String
>
componentNames
=
changeNodeCompName2Map
(
applicationComponents
);
Map
<
Integer
,
Integer
>
componentIds
=
changeNodeCompId2Map
(
applicationComponents
);
Map
<
Integer
,
Integer
>
mappings
=
changeMapping2Map
(
applicationMappings
);
Map
<
Integer
,
Integer
>
mappings
=
changeMapping2Map
(
applicationMappings
);
calleeReferenceMetric
=
calleeReferenceMetricFilter
(
calleeReferenceMetric
);
calleeReferenceMetric
=
calleeReferenceMetricFilter
(
calleeReferenceMetric
);
...
@@ -83,7 +85,7 @@ class TopologyBuilder {
...
@@ -83,7 +85,7 @@ class TopologyBuilder {
ApplicationNode
applicationNode
=
new
ApplicationNode
();
ApplicationNode
applicationNode
=
new
ApplicationNode
();
applicationNode
.
setId
(
applicationId
);
applicationNode
.
setId
(
applicationId
);
applicationNode
.
setName
(
application
.
getApplicationCode
());
applicationNode
.
setName
(
application
.
getApplicationCode
());
applicationNode
.
setType
(
components
.
getOrDefault
(
application
.
getApplicationId
(),
Const
.
UNKNOWN
));
applicationNode
.
setType
(
component
Name
s
.
getOrDefault
(
application
.
getApplicationId
(),
Const
.
UNKNOWN
));
applicationNode
.
setSla
(
SLACalculator
.
INSTANCE
.
calculate
(
applicationMetric
.
getErrorCalls
(),
applicationMetric
.
getCalls
()));
applicationNode
.
setSla
(
SLACalculator
.
INSTANCE
.
calculate
(
applicationMetric
.
getErrorCalls
(),
applicationMetric
.
getCalls
()));
try
{
try
{
...
@@ -129,7 +131,7 @@ class TopologyBuilder {
...
@@ -129,7 +131,7 @@ class TopologyBuilder {
ConjecturalNode
conjecturalNode
=
new
ConjecturalNode
();
ConjecturalNode
conjecturalNode
=
new
ConjecturalNode
();
conjecturalNode
.
setId
(
target
.
getApplicationId
());
conjecturalNode
.
setId
(
target
.
getApplicationId
());
conjecturalNode
.
setName
(
target
.
getApplicationCode
());
conjecturalNode
.
setName
(
target
.
getApplicationCode
());
conjecturalNode
.
setType
(
components
.
getOrDefault
(
target
.
getApplicationId
(),
Const
.
UNKNOWN
));
conjecturalNode
.
setType
(
component
Name
s
.
getOrDefault
(
target
.
getApplicationId
(),
Const
.
UNKNOWN
));
nodes
.
add
(
conjecturalNode
);
nodes
.
add
(
conjecturalNode
);
}
}
...
@@ -141,7 +143,7 @@ class TopologyBuilder {
...
@@ -141,7 +143,7 @@ class TopologyBuilder {
call
.
setTarget
(
actualTargetId
);
call
.
setTarget
(
actualTargetId
);
call
.
setTargetName
(
applicationCacheService
.
getApplicationById
(
actualTargetId
).
getApplicationCode
());
call
.
setTargetName
(
applicationCacheService
.
getApplicationById
(
actualTargetId
).
getApplicationCode
());
call
.
setAlert
(
false
);
call
.
setAlert
(
false
);
call
.
setCallType
(
components
.
get
(
referenceMetric
.
getTarget
()
));
call
.
setCallType
(
ServerTypeDefine
.
getInstance
().
getServerTypeByComponentId
(
componentIds
.
get
(
referenceMetric
.
getTarget
())).
getName
(
));
try
{
try
{
call
.
setCallsPerSec
(
referenceMetric
.
getCalls
()
/
secondBetweenService
.
calculate
(
source
.
getApplicationId
(),
startSecondTimeBucket
,
endSecondTimeBucket
));
call
.
setCallsPerSec
(
referenceMetric
.
getCalls
()
/
secondBetweenService
.
calculate
(
source
.
getApplicationId
(),
startSecondTimeBucket
,
endSecondTimeBucket
));
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
...
@@ -167,7 +169,7 @@ class TopologyBuilder {
...
@@ -167,7 +169,7 @@ class TopologyBuilder {
ConjecturalNode
conjecturalNode
=
new
ConjecturalNode
();
ConjecturalNode
conjecturalNode
=
new
ConjecturalNode
();
conjecturalNode
.
setId
(
source
.
getApplicationId
());
conjecturalNode
.
setId
(
source
.
getApplicationId
());
conjecturalNode
.
setName
(
source
.
getApplicationCode
());
conjecturalNode
.
setName
(
source
.
getApplicationCode
());
conjecturalNode
.
setType
(
components
.
getOrDefault
(
source
.
getApplicationId
(),
Const
.
UNKNOWN
));
conjecturalNode
.
setType
(
component
Name
s
.
getOrDefault
(
source
.
getApplicationId
(),
Const
.
UNKNOWN
));
nodes
.
add
(
conjecturalNode
);
nodes
.
add
(
conjecturalNode
);
}
}
...
@@ -181,7 +183,7 @@ class TopologyBuilder {
...
@@ -181,7 +183,7 @@ class TopologyBuilder {
if
(
source
.
getApplicationId
()
==
Const
.
NONE_APPLICATION_ID
)
{
if
(
source
.
getApplicationId
()
==
Const
.
NONE_APPLICATION_ID
)
{
call
.
setCallType
(
Const
.
EMPTY_STRING
);
call
.
setCallType
(
Const
.
EMPTY_STRING
);
}
else
{
}
else
{
call
.
setCallType
(
components
.
get
(
referenceMetric
.
getTarget
()
));
call
.
setCallType
(
ServerTypeDefine
.
getInstance
().
getServerTypeByComponentId
(
componentIds
.
get
(
referenceMetric
.
getTarget
())).
getName
(
));
}
}
try
{
try
{
call
.
setCallsPerSec
(
referenceMetric
.
getCalls
()
/
secondBetweenService
.
calculate
(
target
.
getApplicationId
(),
startSecondTimeBucket
,
endSecondTimeBucket
));
call
.
setCallsPerSec
(
referenceMetric
.
getCalls
()
/
secondBetweenService
.
calculate
(
target
.
getApplicationId
(),
startSecondTimeBucket
,
endSecondTimeBucket
));
...
@@ -219,7 +221,7 @@ class TopologyBuilder {
...
@@ -219,7 +221,7 @@ class TopologyBuilder {
return
mappings
;
return
mappings
;
}
}
private
Map
<
Integer
,
String
>
changeNodeComp2Map
(
private
Map
<
Integer
,
String
>
changeNodeComp
Name
2Map
(
List
<
IApplicationComponentUIDAO
.
ApplicationComponent
>
applicationComponents
)
{
List
<
IApplicationComponentUIDAO
.
ApplicationComponent
>
applicationComponents
)
{
Map
<
Integer
,
String
>
components
=
new
HashMap
<>();
Map
<
Integer
,
String
>
components
=
new
HashMap
<>();
applicationComponents
.
forEach
(
applicationComponent
->
{
applicationComponents
.
forEach
(
applicationComponent
->
{
...
@@ -228,4 +230,13 @@ class TopologyBuilder {
...
@@ -228,4 +230,13 @@ class TopologyBuilder {
});
});
return
components
;
return
components
;
}
}
private
Map
<
Integer
,
Integer
>
changeNodeCompId2Map
(
List
<
IApplicationComponentUIDAO
.
ApplicationComponent
>
applicationComponents
)
{
Map
<
Integer
,
Integer
>
components
=
new
HashMap
<>();
applicationComponents
.
forEach
(
applicationComponent
->
{
components
.
put
(
applicationComponent
.
getApplicationId
(),
applicationComponent
.
getComponentId
());
});
return
components
;
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录