Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
SkyWalking
提交
718d88c7
S
SkyWalking
项目概览
apache
/
SkyWalking
上一次同步 1 年多
通知
302
Star
21345
Fork
6091
代码
文件
提交
分支
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 搜索 >>
未验证
提交
718d88c7
编写于
3月 03, 2018
作者:
wu-sheng
提交者:
GitHub
3月 03, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into feature/Alarm
上级
1b7ac0f4
e7a6a246
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
32 addition
and
4 deletion
+32
-4
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/InstanceRegisterSerialWorker.java
...ister/provider/register/InstanceRegisterSerialWorker.java
+3
-0
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/service/InstanceIDService.java
...analysis/register/provider/service/InstanceIDService.java
+12
-0
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/Instance.java
...alking/apm/collector/storage/table/register/Instance.java
+9
-0
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/InstanceTable.java
...g/apm/collector/storage/table/register/InstanceTable.java
+1
-0
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/register/InstanceRegisterEsDAO.java
...lector/storage/es/dao/register/InstanceRegisterEsDAO.java
+1
-0
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/InstanceEsUIDAO.java
...king/apm/collector/storage/es/dao/ui/InstanceEsUIDAO.java
+1
-0
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/register/InstanceEsTableDefine.java
...tor/storage/es/define/register/InstanceEsTableDefine.java
+2
-1
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/register/InstanceRegisterH2DAO.java
...lector/storage/h2/dao/register/InstanceRegisterH2DAO.java
+1
-0
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/register/InstanceH2TableDefine.java
...tor/storage/h2/define/register/InstanceH2TableDefine.java
+1
-0
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServerService.java
...he/skywalking/apm/collector/ui/service/ServerService.java
+1
-3
未找到文件。
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/register/InstanceRegisterSerialWorker.java
浏览文件 @
718d88c7
...
...
@@ -73,6 +73,7 @@ public class InstanceRegisterSerialWorker extends AbstractLocalAsyncWorker<Insta
userInstance
.
setId
(
String
.
valueOf
(
Const
.
NONE_INSTANCE_ID
));
userInstance
.
setInstanceId
(
Const
.
NONE_INSTANCE_ID
);
userInstance
.
setApplicationId
(
Const
.
NONE_APPLICATION_ID
);
userInstance
.
setApplicationCode
(
Const
.
USER_CODE
);
userInstance
.
setAgentUUID
(
Const
.
USER_CODE
);
userInstance
.
setHeartBeatTime
(
System
.
currentTimeMillis
());
userInstance
.
setOsInfo
(
Const
.
EMPTY_STRING
);
...
...
@@ -85,6 +86,7 @@ public class InstanceRegisterSerialWorker extends AbstractLocalAsyncWorker<Insta
newInstance
.
setId
(
"2"
);
newInstance
.
setInstanceId
(
2
);
newInstance
.
setApplicationId
(
instance
.
getApplicationId
());
newInstance
.
setApplicationCode
(
instance
.
getApplicationCode
());
newInstance
.
setAgentUUID
(
instance
.
getAgentUUID
());
newInstance
.
setHeartBeatTime
(
instance
.
getHeartBeatTime
());
newInstance
.
setOsInfo
(
instance
.
getOsInfo
());
...
...
@@ -96,6 +98,7 @@ public class InstanceRegisterSerialWorker extends AbstractLocalAsyncWorker<Insta
newInstance
.
setId
(
String
.
valueOf
(
max
+
1
));
newInstance
.
setInstanceId
(
max
+
1
);
newInstance
.
setApplicationId
(
instance
.
getApplicationId
());
newInstance
.
setApplicationCode
(
instance
.
getApplicationCode
());
newInstance
.
setAgentUUID
(
instance
.
getAgentUUID
());
newInstance
.
setHeartBeatTime
(
instance
.
getHeartBeatTime
());
newInstance
.
setOsInfo
(
instance
.
getOsInfo
());
...
...
apm-collector/apm-collector-analysis/analysis-register/register-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/register/provider/service/InstanceIDService.java
浏览文件 @
718d88c7
...
...
@@ -21,6 +21,7 @@ package org.apache.skywalking.apm.collector.analysis.register.provider.service;
import
org.apache.skywalking.apm.collector.analysis.register.define.graph.GraphIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.register.define.service.IInstanceIDService
;
import
org.apache.skywalking.apm.collector.cache.CacheModule
;
import
org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService
;
import
org.apache.skywalking.apm.collector.cache.service.InstanceCacheService
;
import
org.apache.skywalking.apm.collector.core.graph.Graph
;
import
org.apache.skywalking.apm.collector.core.graph.GraphManager
;
...
...
@@ -45,6 +46,7 @@ public class InstanceIDService implements IInstanceIDService {
private
InstanceCacheService
instanceCacheService
;
private
Graph
<
Instance
>
instanceRegisterGraph
;
private
IInstanceRegisterDAO
instanceRegisterDAO
;
private
ApplicationCacheService
applicationCacheService
;
public
InstanceIDService
(
ModuleManager
moduleManager
)
{
this
.
moduleManager
=
moduleManager
;
...
...
@@ -71,6 +73,13 @@ public class InstanceIDService implements IInstanceIDService {
return
instanceRegisterDAO
;
}
private
ApplicationCacheService
getApplicationCacheService
()
{
if
(
ObjectUtils
.
isEmpty
(
applicationCacheService
))
{
this
.
applicationCacheService
=
moduleManager
.
find
(
CacheModule
.
NAME
).
getService
(
ApplicationCacheService
.
class
);
}
return
applicationCacheService
;
}
@Override
public
int
getOrCreateByAgentUUID
(
int
applicationId
,
String
agentUUID
,
long
registerTime
,
String
osInfo
)
{
logger
.
debug
(
"get or getOrCreate instance id by agent UUID, application id: {}, agentUUID: {}, registerTime: {}, osInfo: {}"
,
applicationId
,
agentUUID
,
registerTime
,
osInfo
);
int
instanceId
=
getInstanceCacheService
().
getInstanceIdByAgentUUID
(
applicationId
,
agentUUID
);
...
...
@@ -79,6 +88,7 @@ public class InstanceIDService implements IInstanceIDService {
Instance
instance
=
new
Instance
();
instance
.
setId
(
"0"
);
instance
.
setApplicationId
(
applicationId
);
instance
.
setApplicationCode
(
getApplicationCacheService
().
getApplicationById
(
applicationId
).
getApplicationCode
());
instance
.
setAgentUUID
(
agentUUID
);
instance
.
setRegisterTime
(
registerTime
);
instance
.
setHeartBeatTime
(
registerTime
);
...
...
@@ -100,6 +110,7 @@ public class InstanceIDService implements IInstanceIDService {
Instance
instance
=
new
Instance
();
instance
.
setId
(
"0"
);
instance
.
setApplicationId
(
applicationId
);
instance
.
setApplicationCode
(
getApplicationCacheService
().
getApplicationById
(
applicationId
).
getApplicationCode
());
instance
.
setAgentUUID
(
Const
.
EMPTY_STRING
);
instance
.
setRegisterTime
(
registerTime
);
instance
.
setHeartBeatTime
(
registerTime
);
...
...
@@ -118,6 +129,7 @@ public class InstanceIDService implements IInstanceIDService {
Instance
instance
=
new
Instance
();
instance
.
setId
(
String
.
valueOf
(
instanceId
));
instance
.
setApplicationId
(
applicationId
);
instance
.
setApplicationCode
(
getApplicationCacheService
().
getApplicationById
(
applicationId
).
getApplicationCode
());
instance
.
setAgentUUID
(
""
);
instance
.
setRegisterTime
(
registerTime
);
instance
.
setHeartBeatTime
(
registerTime
);
...
...
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/Instance.java
浏览文件 @
718d88c7
...
...
@@ -32,6 +32,7 @@ public class Instance extends StreamData {
new
Column
(
InstanceTable
.
COLUMN_ID
,
new
NonOperation
()),
new
Column
(
InstanceTable
.
COLUMN_AGENT_UUID
,
new
CoverOperation
()),
new
Column
(
InstanceTable
.
COLUMN_OS_INFO
,
new
CoverOperation
()),
new
Column
(
InstanceTable
.
COLUMN_APPLICATION_CODE
,
new
CoverOperation
()),
};
private
static
final
Column
[]
LONG_COLUMNS
=
{
...
...
@@ -118,6 +119,14 @@ public class Instance extends StreamData {
setDataString
(
2
,
osInfo
);
}
public
String
getApplicationCode
()
{
return
getDataString
(
3
);
}
public
void
setApplicationCode
(
String
applicationCode
)
{
setDataString
(
3
,
applicationCode
);
}
public
int
getAddressId
()
{
return
getDataInteger
(
2
);
}
...
...
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/register/InstanceTable.java
浏览文件 @
718d88c7
...
...
@@ -26,6 +26,7 @@ import org.apache.skywalking.apm.collector.core.data.CommonTable;
public
class
InstanceTable
extends
CommonTable
{
public
static
final
String
TABLE
=
"instance"
;
public
static
final
String
COLUMN_APPLICATION_ID
=
"application_id"
;
public
static
final
String
COLUMN_APPLICATION_CODE
=
"application_code"
;
public
static
final
String
COLUMN_AGENT_UUID
=
"agent_uuid"
;
public
static
final
String
COLUMN_REGISTER_TIME
=
"register_time"
;
public
static
final
String
COLUMN_INSTANCE_ID
=
"instance_id"
;
...
...
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/register/InstanceRegisterEsDAO.java
浏览文件 @
718d88c7
...
...
@@ -57,6 +57,7 @@ public class InstanceRegisterEsDAO extends EsDAO implements IInstanceRegisterDAO
Map
<
String
,
Object
>
source
=
new
HashMap
<>();
source
.
put
(
InstanceTable
.
COLUMN_INSTANCE_ID
,
instance
.
getInstanceId
());
source
.
put
(
InstanceTable
.
COLUMN_APPLICATION_ID
,
instance
.
getApplicationId
());
source
.
put
(
InstanceTable
.
COLUMN_APPLICATION_CODE
,
instance
.
getApplicationCode
());
source
.
put
(
InstanceTable
.
COLUMN_AGENT_UUID
,
instance
.
getAgentUUID
());
source
.
put
(
InstanceTable
.
COLUMN_REGISTER_TIME
,
TimeBucketUtils
.
INSTANCE
.
getSecondTimeBucket
(
instance
.
getRegisterTime
()));
source
.
put
(
InstanceTable
.
COLUMN_HEARTBEAT_TIME
,
TimeBucketUtils
.
INSTANCE
.
getSecondTimeBucket
(
instance
.
getHeartBeatTime
()));
...
...
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/InstanceEsUIDAO.java
浏览文件 @
718d88c7
...
...
@@ -249,6 +249,7 @@ public class InstanceEsUIDAO extends EsDAO implements IInstanceUIDAO {
for
(
SearchHit
searchHit
:
searchHits
)
{
AppServerInfo
appServerInfo
=
new
AppServerInfo
();
appServerInfo
.
setId
(((
Number
)
searchHit
.
getSource
().
get
(
InstanceTable
.
COLUMN_INSTANCE_ID
)).
intValue
());
appServerInfo
.
setApplicationId
(((
Number
)
searchHit
.
getSource
().
get
(
InstanceTable
.
COLUMN_APPLICATION_ID
)).
intValue
());
appServerInfo
.
setOsInfo
((
String
)
searchHit
.
getSource
().
get
(
InstanceTable
.
COLUMN_OS_INFO
));
appServerInfos
.
add
(
appServerInfo
);
}
...
...
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/register/InstanceEsTableDefine.java
浏览文件 @
718d88c7
...
...
@@ -37,11 +37,12 @@ public class InstanceEsTableDefine extends ElasticSearchTableDefine {
@Override
public
void
initialize
()
{
addColumn
(
new
ElasticSearchColumnDefine
(
InstanceTable
.
COLUMN_APPLICATION_ID
,
ElasticSearchColumnDefine
.
Type
.
Integer
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
InstanceTable
.
COLUMN_APPLICATION_CODE
,
ElasticSearchColumnDefine
.
Type
.
Text
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
InstanceTable
.
COLUMN_AGENT_UUID
,
ElasticSearchColumnDefine
.
Type
.
Keyword
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
InstanceTable
.
COLUMN_REGISTER_TIME
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
InstanceTable
.
COLUMN_INSTANCE_ID
,
ElasticSearchColumnDefine
.
Type
.
Integer
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
InstanceTable
.
COLUMN_HEARTBEAT_TIME
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
InstanceTable
.
COLUMN_OS_INFO
,
ElasticSearchColumnDefine
.
Type
.
Keyword
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
InstanceTable
.
COLUMN_OS_INFO
,
ElasticSearchColumnDefine
.
Type
.
Text
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
InstanceTable
.
COLUMN_ADDRESS_ID
,
ElasticSearchColumnDefine
.
Type
.
Integer
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
InstanceTable
.
COLUMN_IS_ADDRESS
,
ElasticSearchColumnDefine
.
Type
.
Integer
.
name
()));
}
...
...
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/register/InstanceRegisterH2DAO.java
浏览文件 @
718d88c7
...
...
@@ -58,6 +58,7 @@ public class InstanceRegisterH2DAO extends H2DAO implements IInstanceRegisterDAO
source
.
put
(
InstanceTable
.
COLUMN_ID
,
instance
.
getId
());
source
.
put
(
InstanceTable
.
COLUMN_INSTANCE_ID
,
instance
.
getInstanceId
());
source
.
put
(
InstanceTable
.
COLUMN_APPLICATION_ID
,
instance
.
getApplicationId
());
source
.
put
(
InstanceTable
.
COLUMN_APPLICATION_CODE
,
instance
.
getApplicationCode
());
source
.
put
(
InstanceTable
.
COLUMN_AGENT_UUID
,
instance
.
getAgentUUID
());
source
.
put
(
InstanceTable
.
COLUMN_REGISTER_TIME
,
TimeBucketUtils
.
INSTANCE
.
getSecondTimeBucket
(
instance
.
getRegisterTime
()));
source
.
put
(
InstanceTable
.
COLUMN_HEARTBEAT_TIME
,
TimeBucketUtils
.
INSTANCE
.
getSecondTimeBucket
(
instance
.
getHeartBeatTime
()));
...
...
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/define/register/InstanceH2TableDefine.java
浏览文件 @
718d88c7
...
...
@@ -34,6 +34,7 @@ public class InstanceH2TableDefine extends H2TableDefine {
@Override
public
void
initialize
()
{
addColumn
(
new
H2ColumnDefine
(
InstanceTable
.
COLUMN_ID
,
H2ColumnDefine
.
Type
.
Varchar
.
name
()));
addColumn
(
new
H2ColumnDefine
(
InstanceTable
.
COLUMN_APPLICATION_ID
,
H2ColumnDefine
.
Type
.
Int
.
name
()));
addColumn
(
new
H2ColumnDefine
(
InstanceTable
.
COLUMN_APPLICATION_CODE
,
H2ColumnDefine
.
Type
.
Varchar
.
name
()));
addColumn
(
new
H2ColumnDefine
(
InstanceTable
.
COLUMN_AGENT_UUID
,
H2ColumnDefine
.
Type
.
Varchar
.
name
()));
addColumn
(
new
H2ColumnDefine
(
InstanceTable
.
COLUMN_REGISTER_TIME
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
addColumn
(
new
H2ColumnDefine
(
InstanceTable
.
COLUMN_INSTANCE_ID
,
H2ColumnDefine
.
Type
.
Int
.
name
()));
...
...
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServerService.java
浏览文件 @
718d88c7
...
...
@@ -163,9 +163,7 @@ public class ServerService {
private
void
buildAppServerInfo
(
List
<
AppServerInfo
>
serverInfos
)
{
serverInfos
.
forEach
(
serverInfo
->
{
int
applicationId
=
instanceCacheService
.
getApplicationId
(
serverInfo
.
getId
());
serverInfo
.
setApplicationId
(
applicationId
);
serverInfo
.
setApplicationCode
(
applicationCacheService
.
getApplicationById
(
applicationId
).
getApplicationCode
());
serverInfo
.
setApplicationCode
(
applicationCacheService
.
getApplicationById
(
serverInfo
.
getApplicationId
()).
getApplicationCode
());
if
(
StringUtils
.
isNotEmpty
(
serverInfo
.
getOsInfo
()))
{
JsonObject
osInfoJson
=
gson
.
fromJson
(
serverInfo
.
getOsInfo
(),
JsonObject
.
class
);
if
(
osInfoJson
.
has
(
"osName"
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录