Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
润土的好友猹
SkyWalking
提交
91c03289
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,发现更多精彩内容 >>
提交
91c03289
编写于
9月 11, 2017
作者:
P
pengys5
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
service tree merge error
上级
122ff6d4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
16 deletion
+16
-16
apm-collector/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/storage/StorageInstaller.java
...ywalking/apm/collector/core/storage/StorageInstaller.java
+2
-1
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/dao/ServiceReferenceEsDAO.java
...kywalking/apm/collector/ui/dao/ServiceReferenceEsDAO.java
+8
-7
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/handler/time/AllInstanceLastTimeGetHandler.java
.../ui/jetty/handler/time/AllInstanceLastTimeGetHandler.java
+6
-8
未找到文件。
apm-collector/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/storage/StorageInstaller.java
浏览文件 @
91c03289
...
...
@@ -18,13 +18,14 @@ public abstract class StorageInstaller {
try
{
List
<
TableDefine
>
tableDefines
=
defineLoader
.
load
();
defineFilter
(
tableDefines
);
Boolean
debug
=
System
.
getProperty
(
"debug"
)
!=
null
;
for
(
TableDefine
tableDefine
:
tableDefines
)
{
tableDefine
.
initialize
();
if
(!
isExists
(
client
,
tableDefine
))
{
logger
.
info
(
"table: {} not exists"
,
tableDefine
.
getName
());
createTable
(
client
,
tableDefine
);
}
else
{
}
else
if
(
debug
)
{
logger
.
info
(
"table: {} exists"
,
tableDefine
.
getName
());
deleteTable
(
client
,
tableDefine
);
createTable
(
client
,
tableDefine
);
...
...
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/dao/ServiceReferenceEsDAO.java
浏览文件 @
91c03289
...
...
@@ -110,13 +110,15 @@ public class ServiceReferenceEsDAO extends EsDAO implements IServiceReferenceDAO
.
subAggregation
(
AggregationBuilders
.
sum
(
ServiceReferenceTable
.
COLUMN_SUMMARY
).
field
(
ServiceReferenceTable
.
COLUMN_SUMMARY
))
.
subAggregation
(
AggregationBuilders
.
sum
(
ServiceReferenceTable
.
COLUMN_COST_SUMMARY
).
field
(
ServiceReferenceTable
.
COLUMN_COST_SUMMARY
))));
Map
<
String
,
JsonObject
>
serviceReferenceMap
=
new
LinkedHashMap
<>();
JsonArray
serviceReferenceArray
=
new
JsonArray
();
SearchResponse
searchResponse
=
searchRequestBuilder
.
get
();
Terms
frontServiceIdTerms
=
searchResponse
.
getAggregations
().
get
(
ServiceReferenceTable
.
COLUMN_FRONT_SERVICE_ID
);
for
(
Terms
.
Bucket
frontServiceBucket
:
frontServiceIdTerms
.
getBuckets
())
{
int
frontServiceId
=
frontServiceBucket
.
getKeyAsNumber
().
intValue
();
if
(
frontServiceId
!=
0
)
{
parseSubAggregate
(
serviceReferenceArray
,
frontServiceBucket
,
frontServiceId
);
parseSubAggregate
(
serviceReference
Map
,
serviceReference
Array
,
frontServiceBucket
,
frontServiceId
);
}
}
...
...
@@ -126,16 +128,17 @@ public class ServiceReferenceEsDAO extends EsDAO implements IServiceReferenceDAO
if
(
StringUtils
.
isNotEmpty
(
frontServiceName
))
{
String
[]
serviceNames
=
frontServiceName
.
split
(
Const
.
ID_SPLIT
);
int
frontServiceId
=
ServiceIdCache
.
getForUI
(
Integer
.
parseInt
(
serviceNames
[
0
]),
serviceNames
[
1
]);
parseSubAggregate
(
serviceReferenceArray
,
frontServiceBucket
,
frontServiceId
);
parseSubAggregate
(
serviceReference
Map
,
serviceReference
Array
,
frontServiceBucket
,
frontServiceId
);
}
}
serviceReferenceMap
.
values
().
forEach
(
serviceReferenceArray:
:
add
);
return
serviceReferenceArray
;
}
private
void
parseSubAggregate
(
JsonArray
serviceReferenceArray
,
Terms
.
Bucket
frontServiceBucket
,
private
void
parseSubAggregate
(
Map
<
String
,
JsonObject
>
serviceReferenceMap
,
JsonArray
serviceReferenceArray
,
Terms
.
Bucket
frontServiceBucket
,
int
frontServiceId
)
{
Map
<
String
,
JsonObject
>
serviceReferenceMap
=
new
LinkedHashMap
<>();
Terms
behindServiceIdTerms
=
frontServiceBucket
.
getAggregations
().
get
(
ServiceReferenceTable
.
COLUMN_BEHIND_SERVICE_ID
);
for
(
Terms
.
Bucket
behindServiceIdBucket
:
behindServiceIdTerms
.
getBuckets
())
{
int
behindServiceId
=
behindServiceIdBucket
.
getKeyAsNumber
().
intValue
();
...
...
@@ -205,8 +208,6 @@ public class ServiceReferenceEsDAO extends EsDAO implements IServiceReferenceDAO
merge
(
serviceReferenceMap
,
serviceReference
);
}
}
serviceReferenceMap
.
values
().
forEach
(
serviceReferenceArray:
:
add
);
}
private
void
merge
(
Map
<
String
,
JsonObject
>
serviceReferenceMap
,
JsonObject
serviceReference
)
{
...
...
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/jetty/handler/time/AllInstanceLastTimeGetHandler.java
浏览文件 @
91c03289
...
...
@@ -28,18 +28,16 @@ public class AllInstanceLastTimeGetHandler extends JettyHandler {
Long
timeBucket
=
service
.
allInstanceLastTime
();
logger
.
debug
(
"all instance last time: {}"
,
timeBucket
);
long
instanceTimeBucket
;
if
(
timeBucket
==
0
)
{
instanceTimeBucket
=
0
;
}
else
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTimeInMillis
(
TimeBucketUtils
.
INSTANCE
.
changeTimeBucket2TimeStamp
(
TimeBucketUtils
.
TimeBucketType
.
SECOND
.
name
(),
timeBucket
));
calendar
.
add
(
Calendar
.
SECOND
,
-
5
);
instanceTimeBucket
=
calendar
.
getTimeInMillis
();
timeBucket
=
TimeBucketUtils
.
INSTANCE
.
getSecondTimeBucket
(
System
.
currentTimeMillis
());
}
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTimeInMillis
(
TimeBucketUtils
.
INSTANCE
.
changeTimeBucket2TimeStamp
(
TimeBucketUtils
.
TimeBucketType
.
SECOND
.
name
(),
timeBucket
));
calendar
.
add
(
Calendar
.
SECOND
,
-
5
);
timeBucket
=
calendar
.
getTimeInMillis
();
JsonObject
timeJson
=
new
JsonObject
();
timeJson
.
addProperty
(
"timeBucket"
,
TimeBucketUtils
.
INSTANCE
.
getSecondTimeBucket
(
instanceT
imeBucket
));
timeJson
.
addProperty
(
"timeBucket"
,
TimeBucketUtils
.
INSTANCE
.
getSecondTimeBucket
(
t
imeBucket
));
return
timeJson
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录