Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
javalover123888
SkyWalking
提交
425324ee
S
SkyWalking
项目概览
javalover123888
/
SkyWalking
与 Fork 源项目一致
Fork自
山不在高_有仙则灵 / SkyWalking
通知
2
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,发现更多精彩内容 >>
提交
425324ee
编写于
2月 08, 2018
作者:
P
peng-yongsheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Provide the overview/getTopNSlowService query.
上级
7b2cb2e4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
6 deletion
+27
-6
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ServiceMetricEsUIDAO.java
...apm/collector/storage/es/dao/ui/ServiceMetricEsUIDAO.java
+4
-2
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
+5
-3
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServiceNameService.java
...ywalking/apm/collector/ui/service/ServiceNameService.java
+17
-0
apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/overview-layer.graphqls
...col/src/main/resources/ui-graphql/overview-layer.graphqls
+1
-1
未找到文件。
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ServiceMetricEsUIDAO.java
浏览文件 @
425324ee
...
...
@@ -162,13 +162,15 @@ public class ServiceMetricEsUIDAO extends EsDAO implements IServiceMetricUIDAO {
BoolQueryBuilder
boolQuery
=
QueryBuilders
.
boolQuery
();
boolQuery
.
must
().
add
(
QueryBuilders
.
rangeQuery
(
ServiceMetricTable
.
COLUMN_TIME_BUCKET
).
gte
(
start
).
lte
(
end
));
boolQuery
.
must
().
add
(
QueryBuilders
.
termQuery
(
ServiceMetricTable
.
COLUMN_APPLICATION_ID
,
applicationId
));
if
(
applicationId
!=
0
)
{
boolQuery
.
must
().
add
(
QueryBuilders
.
termQuery
(
ServiceMetricTable
.
COLUMN_APPLICATION_ID
,
applicationId
));
}
boolQuery
.
must
().
add
(
QueryBuilders
.
termQuery
(
ServiceMetricTable
.
COLUMN_SOURCE_VALUE
,
metricSource
.
getValue
()));
searchRequestBuilder
.
setQuery
(
boolQuery
);
searchRequestBuilder
.
setSize
(
0
);
TermsAggregationBuilder
aggregationBuilder
=
AggregationBuilders
.
terms
(
ServiceMetricTable
.
COLUMN_SERVICE_ID
).
field
(
ServiceMetricTable
.
COLUMN_SERVICE_ID
).
size
(
100
);
TermsAggregationBuilder
aggregationBuilder
=
AggregationBuilders
.
terms
(
ServiceMetricTable
.
COLUMN_SERVICE_ID
).
field
(
ServiceMetricTable
.
COLUMN_SERVICE_ID
).
size
(
top
);
aggregationBuilder
.
subAggregation
(
AggregationBuilders
.
sum
(
ServiceMetricTable
.
COLUMN_TRANSACTION_CALLS
).
field
(
ServiceMetricTable
.
COLUMN_TRANSACTION_CALLS
));
aggregationBuilder
.
subAggregation
(
AggregationBuilders
.
sum
(
ServiceMetricTable
.
COLUMN_TRANSACTION_ERROR_CALLS
).
field
(
ServiceMetricTable
.
COLUMN_TRANSACTION_ERROR_CALLS
));
aggregationBuilder
.
subAggregation
(
AggregationBuilders
.
sum
(
ServiceMetricTable
.
COLUMN_TRANSACTION_DURATION_SUM
).
field
(
ServiceMetricTable
.
COLUMN_TRANSACTION_DURATION_SUM
));
...
...
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/OverViewLayerQuery.java
浏览文件 @
425324ee
...
...
@@ -28,7 +28,7 @@ import org.apache.skywalking.apm.collector.storage.ui.overview.AlarmTrend;
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.server.AppServerInfo
;
import
org.apache.skywalking.apm.collector.storage.ui.service.Service
Info
;
import
org.apache.skywalking.apm.collector.storage.ui.service.Service
Metric
;
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
;
...
...
@@ -118,8 +118,10 @@ public class OverViewLayerQuery implements Query {
return
null
;
}
public
List
<
ServiceInfo
>
getTopNSlowService
(
Duration
duration
,
int
topN
)
{
return
null
;
public
List
<
ServiceMetric
>
getTopNSlowService
(
Duration
duration
,
int
topN
)
throws
ParseException
{
long
start
=
DurationUtils
.
INSTANCE
.
exchangeToTimeBucket
(
duration
.
getStart
());
long
end
=
DurationUtils
.
INSTANCE
.
exchangeToTimeBucket
(
duration
.
getEnd
());
return
getServiceNameService
().
getSlowService
(
duration
.
getStep
(),
start
,
end
,
topN
);
}
public
List
<
AppServerInfo
>
getTopNServerThroughput
(
Duration
duration
,
int
topN
)
{
...
...
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServiceNameService.java
浏览文件 @
425324ee
...
...
@@ -20,14 +20,18 @@ package org.apache.skywalking.apm.collector.ui.service;
import
java.text.ParseException
;
import
java.util.List
;
import
org.apache.skywalking.apm.collector.cache.CacheModule
;
import
org.apache.skywalking.apm.collector.cache.service.ServiceNameCacheService
;
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.IServiceMetricUIDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.ui.IServiceNameServiceUIDAO
;
import
org.apache.skywalking.apm.collector.storage.table.MetricSource
;
import
org.apache.skywalking.apm.collector.storage.ui.common.ResponseTimeTrend
;
import
org.apache.skywalking.apm.collector.storage.ui.common.SLATrend
;
import
org.apache.skywalking.apm.collector.storage.ui.common.Step
;
import
org.apache.skywalking.apm.collector.storage.ui.service.ServiceInfo
;
import
org.apache.skywalking.apm.collector.storage.ui.service.ServiceMetric
;
import
org.apache.skywalking.apm.collector.storage.utils.DurationPoint
;
import
org.apache.skywalking.apm.collector.ui.utils.DurationUtils
;
...
...
@@ -38,10 +42,12 @@ public class ServiceNameService {
private
final
IServiceNameServiceUIDAO
serviceNameServiceUIDAO
;
private
final
IServiceMetricUIDAO
serviceMetricUIDAO
;
private
final
ServiceNameCacheService
serviceNameCacheService
;
public
ServiceNameService
(
ModuleManager
moduleManager
)
{
this
.
serviceNameServiceUIDAO
=
moduleManager
.
find
(
StorageModule
.
NAME
).
getService
(
IServiceNameServiceUIDAO
.
class
);
this
.
serviceMetricUIDAO
=
moduleManager
.
find
(
StorageModule
.
NAME
).
getService
(
IServiceMetricUIDAO
.
class
);
this
.
serviceNameCacheService
=
moduleManager
.
find
(
CacheModule
.
NAME
).
getService
(
ServiceNameCacheService
.
class
);
}
public
int
getCount
()
{
...
...
@@ -66,4 +72,15 @@ public class ServiceNameService {
slaTrend
.
setTrendList
(
serviceMetricUIDAO
.
getServiceSLATrend
(
serviceId
,
step
,
durationPoints
));
return
slaTrend
;
}
public
List
<
ServiceMetric
>
getSlowService
(
Step
step
,
long
start
,
long
end
,
Integer
top
)
throws
ParseException
{
List
<
ServiceMetric
>
slowServices
=
serviceMetricUIDAO
.
getSlowService
(
0
,
step
,
start
,
end
,
top
,
MetricSource
.
Callee
);
slowServices
.
forEach
(
slowService
->
{
slowService
.
setName
(
serviceNameCacheService
.
get
(
slowService
.
getId
()).
getServiceName
());
//TODO
slowService
.
setTps
(
1
);
});
return
slowServices
;
}
}
apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/overview-layer.graphqls
浏览文件 @
425324ee
...
...
@@ -32,6 +32,6 @@ extend type Query {
getClusterBrief(duration: Duration!): ClusterBrief
getAlarmTrend(duration: Duration!): AlarmTrend
getConjecturalApps(duration: Duration!): ConjecturalAppBrief
getTopNSlowService(duration: Duration!, topN: Int!): [Service
Info
!]!
getTopNSlowService(duration: Duration!, topN: Int!): [Service
Metric
!]!
getTopNServerThroughput(duration: Duration!, topN: Int!): [AppServerInfo!]!
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录