Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
山不在高_有仙则灵
SkyWalking
提交
e233b7be
S
SkyWalking
项目概览
山不在高_有仙则灵
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
12
Star
0
Fork
2
代码
文件
提交
分支
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,发现更多精彩内容 >>
未验证
提交
e233b7be
编写于
2月 10, 2018
作者:
李
李运涛 liyuntao
提交者:
GitHub
2月 10, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into servicecomb
上级
cbb2eca2
6fc45792
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
359 addition
and
37 deletion
+359
-37
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/StorageModule.java
...pache/skywalking/apm/collector/storage/StorageModule.java
+2
-0
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IApplicationMetricUIDAO.java
...apm/collector/storage/dao/ui/IApplicationMetricUIDAO.java
+33
-0
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IInstanceMetricUIDAO.java
...ng/apm/collector/storage/dao/ui/IInstanceMetricUIDAO.java
+1
-1
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IServiceMetricUIDAO.java
...ing/apm/collector/storage/dao/ui/IServiceMetricUIDAO.java
+2
-0
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ThroughputTrend.java
...king/apm/collector/storage/ui/common/ThroughputTrend.java
+5
-0
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ApplicationTPS.java
...ing/apm/collector/storage/ui/overview/ApplicationTPS.java
+52
-0
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/StorageModuleEsProvider.java
...ing/apm/collector/storage/es/StorageModuleEsProvider.java
+3
-0
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ApplicationMetricEsUIDAO.java
...collector/storage/es/dao/ui/ApplicationMetricEsUIDAO.java
+104
-0
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/InstanceMetricEsUIDAO.java
...pm/collector/storage/es/dao/ui/InstanceMetricEsUIDAO.java
+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
...apm/collector/storage/es/dao/ui/ServiceMetricEsUIDAO.java
+23
-0
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/StorageModuleH2Provider.java
...ing/apm/collector/storage/h2/StorageModuleH2Provider.java
+3
-0
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ApplicationMetricH2UIDAO.java
...collector/storage/h2/dao/ui/ApplicationMetricH2UIDAO.java
+47
-0
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/InstanceMetricH2UIDAO.java
...pm/collector/storage/h2/dao/ui/InstanceMetricH2UIDAO.java
+1
-1
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ServiceMetricH2UIDAO.java
...apm/collector/storage/h2/dao/ui/ServiceMetricH2UIDAO.java
+4
-0
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQuery.java
...e/skywalking/apm/collector/ui/query/ApplicationQuery.java
+18
-4
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
+3
-12
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServiceQuery.java
...pache/skywalking/apm/collector/ui/query/ServiceQuery.java
+5
-2
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
+15
-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
+15
-12
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
+12
-0
apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls
.../src/main/resources/ui-graphql/application-layer.graphqls
+2
-2
apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/overview-layer.graphqls
...col/src/main/resources/ui-graphql/overview-layer.graphqls
+7
-1
apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/server-layer.graphqls
...tocol/src/main/resources/ui-graphql/server-layer.graphqls
+1
-1
未找到文件。
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/StorageModule.java
浏览文件 @
e233b7be
...
...
@@ -104,6 +104,7 @@ import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMin
import
org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMonthMetricPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationComponentUIDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMappingUIDAO
;
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.ICpuMetricUIDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.ui.IGCMetricUIDAO
;
...
...
@@ -248,6 +249,7 @@ public class StorageModule extends Module {
classes
.
add
(
IInstanceMetricUIDAO
.
class
);
classes
.
add
(
IApplicationComponentUIDAO
.
class
);
classes
.
add
(
IApplicationMappingUIDAO
.
class
);
classes
.
add
(
IApplicationMetricUIDAO
.
class
);
classes
.
add
(
IApplicationReferenceMetricUIDAO
.
class
);
classes
.
add
(
ISegmentDurationUIDAO
.
class
);
classes
.
add
(
ISegmentUIDAO
.
class
);
...
...
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IApplicationMetricUIDAO.java
0 → 100644
浏览文件 @
e233b7be
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.collector.storage.dao.ui
;
import
java.util.List
;
import
org.apache.skywalking.apm.collector.storage.base.dao.DAO
;
import
org.apache.skywalking.apm.collector.storage.table.MetricSource
;
import
org.apache.skywalking.apm.collector.storage.ui.common.Step
;
import
org.apache.skywalking.apm.collector.storage.ui.overview.ApplicationTPS
;
/**
* @author peng-yongsheng
*/
public
interface
IApplicationMetricUIDAO
extends
DAO
{
List
<
ApplicationTPS
>
getTopNApplicationThroughput
(
Step
step
,
long
start
,
long
end
,
long
betweenSecond
,
int
topN
,
MetricSource
metricSource
);
}
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IInstanceMetricUIDAO.java
浏览文件 @
e233b7be
...
...
@@ -30,7 +30,7 @@ import org.apache.skywalking.apm.collector.storage.utils.DurationPoint;
*/
public
interface
IInstanceMetricUIDAO
extends
DAO
{
List
<
AppServerInfo
>
get
TopN
ServerThroughput
(
int
applicationId
,
Step
step
,
long
start
,
long
end
,
long
secondBetween
,
List
<
AppServerInfo
>
getServerThroughput
(
int
applicationId
,
Step
step
,
long
start
,
long
end
,
long
secondBetween
,
int
topN
,
MetricSource
metricSource
);
...
...
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IServiceMetricUIDAO.java
浏览文件 @
e233b7be
...
...
@@ -33,6 +33,8 @@ import org.apache.skywalking.apm.collector.storage.utils.DurationPoint;
public
interface
IServiceMetricUIDAO
extends
DAO
{
List
<
Integer
>
getServiceResponseTimeTrend
(
int
serviceId
,
Step
step
,
List
<
DurationPoint
>
durationPoints
);
List
<
Integer
>
getServiceTPSTrend
(
int
serviceId
,
Step
step
,
List
<
DurationPoint
>
durationPoints
);
List
<
Integer
>
getServiceSLATrend
(
int
serviceId
,
Step
step
,
List
<
DurationPoint
>
durationPoints
);
List
<
Node
>
getServicesMetric
(
Step
step
,
long
startTime
,
long
endTime
,
...
...
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/common/ThroughputTrend.java
浏览文件 @
e233b7be
...
...
@@ -18,6 +18,7 @@
package
org.apache.skywalking.apm.collector.storage.ui.common
;
import
java.util.LinkedList
;
import
java.util.List
;
/**
...
...
@@ -26,6 +27,10 @@ import java.util.List;
public
class
ThroughputTrend
{
private
List
<
Integer
>
trendList
;
public
ThroughputTrend
()
{
this
.
trendList
=
new
LinkedList
<>();
}
public
List
<
Integer
>
getTrendList
()
{
return
trendList
;
}
...
...
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/overview/ApplicationTPS.java
0 → 100644
浏览文件 @
e233b7be
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.collector.storage.ui.overview
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationTPS
{
private
int
applicationId
;
private
String
applicationCode
;
private
int
tps
;
public
int
getApplicationId
()
{
return
applicationId
;
}
public
void
setApplicationId
(
int
applicationId
)
{
this
.
applicationId
=
applicationId
;
}
public
String
getApplicationCode
()
{
return
applicationCode
;
}
public
void
setApplicationCode
(
String
applicationCode
)
{
this
.
applicationCode
=
applicationCode
;
}
public
int
getTps
()
{
return
tps
;
}
public
void
setTps
(
int
tps
)
{
this
.
tps
=
tps
;
}
}
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/StorageModuleEsProvider.java
浏览文件 @
e233b7be
...
...
@@ -113,6 +113,7 @@ import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMin
import
org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMonthMetricPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationComponentUIDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMappingUIDAO
;
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.ICpuMetricUIDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.ui.IGCMetricUIDAO
;
...
...
@@ -211,6 +212,7 @@ import org.apache.skywalking.apm.collector.storage.es.dao.srmp.ServiceReferenceM
import
org.apache.skywalking.apm.collector.storage.es.dao.srmp.ServiceReferenceMonthMetricEsPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.ui.ApplicationComponentEsUIDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.ui.ApplicationMappingEsUIDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.ui.ApplicationMetricEsUIDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.ui.ApplicationReferenceMetricEsUIDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.ui.CpuMetricEsUIDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.ui.GCMetricEsUIDAO
;
...
...
@@ -407,6 +409,7 @@ public class StorageModuleEsProvider extends ModuleProvider {
this
.
registerServiceImplementation
(
IInstanceMetricUIDAO
.
class
,
new
InstanceMetricEsUIDAO
(
elasticSearchClient
));
this
.
registerServiceImplementation
(
IApplicationComponentUIDAO
.
class
,
new
ApplicationComponentEsUIDAO
(
elasticSearchClient
));
this
.
registerServiceImplementation
(
IApplicationMappingUIDAO
.
class
,
new
ApplicationMappingEsUIDAO
(
elasticSearchClient
));
this
.
registerServiceImplementation
(
IApplicationMetricUIDAO
.
class
,
new
ApplicationMetricEsUIDAO
(
elasticSearchClient
));
this
.
registerServiceImplementation
(
IApplicationReferenceMetricUIDAO
.
class
,
new
ApplicationReferenceMetricEsUIDAO
(
elasticSearchClient
));
this
.
registerServiceImplementation
(
ISegmentDurationUIDAO
.
class
,
new
SegmentDurationEsUIDAO
(
elasticSearchClient
));
this
.
registerServiceImplementation
(
ISegmentUIDAO
.
class
,
new
SegmentEsUIDAO
(
elasticSearchClient
));
...
...
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ApplicationMetricEsUIDAO.java
0 → 100644
浏览文件 @
e233b7be
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.collector.storage.es.dao.ui
;
import
java.util.HashMap
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient
;
import
org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMetricUIDAO
;
import
org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO
;
import
org.apache.skywalking.apm.collector.storage.table.MetricSource
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetricTable
;
import
org.apache.skywalking.apm.collector.storage.ui.common.Step
;
import
org.apache.skywalking.apm.collector.storage.ui.overview.ApplicationTPS
;
import
org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder
;
import
org.elasticsearch.action.search.SearchRequestBuilder
;
import
org.elasticsearch.action.search.SearchResponse
;
import
org.elasticsearch.action.search.SearchType
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.script.Script
;
import
org.elasticsearch.search.aggregations.AggregationBuilders
;
import
org.elasticsearch.search.aggregations.bucket.terms.Terms
;
import
org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder
;
import
org.elasticsearch.search.aggregations.pipeline.InternalSimpleValue
;
import
org.elasticsearch.search.aggregations.pipeline.PipelineAggregatorBuilders
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationMetricEsUIDAO
extends
EsDAO
implements
IApplicationMetricUIDAO
{
public
ApplicationMetricEsUIDAO
(
ElasticSearchClient
client
)
{
super
(
client
);
}
private
static
final
String
AVG_TPS
=
"avg_tps"
;
@Override
public
List
<
ApplicationTPS
>
getTopNApplicationThroughput
(
Step
step
,
long
start
,
long
end
,
long
betweenSecond
,
int
topN
,
MetricSource
metricSource
)
{
String
tableName
=
TimePyramidTableNameBuilder
.
build
(
step
,
ApplicationMetricTable
.
TABLE
);
SearchRequestBuilder
searchRequestBuilder
=
getClient
().
prepareSearch
(
tableName
);
searchRequestBuilder
.
setTypes
(
ApplicationMetricTable
.
TABLE_TYPE
);
searchRequestBuilder
.
setSearchType
(
SearchType
.
DFS_QUERY_THEN_FETCH
);
BoolQueryBuilder
boolQuery
=
QueryBuilders
.
boolQuery
();
boolQuery
.
must
().
add
(
QueryBuilders
.
rangeQuery
(
ApplicationMetricTable
.
COLUMN_TIME_BUCKET
).
gte
(
start
).
lte
(
end
));
boolQuery
.
must
().
add
(
QueryBuilders
.
termQuery
(
ApplicationMetricTable
.
COLUMN_SOURCE_VALUE
,
metricSource
.
getValue
()));
searchRequestBuilder
.
setQuery
(
boolQuery
);
searchRequestBuilder
.
setSize
(
0
);
TermsAggregationBuilder
aggregationBuilder
=
AggregationBuilders
.
terms
(
ApplicationMetricTable
.
COLUMN_APPLICATION_ID
).
field
(
ApplicationMetricTable
.
COLUMN_APPLICATION_ID
).
size
(
topN
);
aggregationBuilder
.
subAggregation
(
AggregationBuilders
.
sum
(
ApplicationMetricTable
.
COLUMN_TRANSACTION_CALLS
).
field
(
ApplicationMetricTable
.
COLUMN_TRANSACTION_CALLS
));
aggregationBuilder
.
subAggregation
(
AggregationBuilders
.
sum
(
ApplicationMetricTable
.
COLUMN_TRANSACTION_ERROR_CALLS
).
field
(
ApplicationMetricTable
.
COLUMN_TRANSACTION_ERROR_CALLS
));
Map
<
String
,
String
>
bucketsPathsMap
=
new
HashMap
<>();
bucketsPathsMap
.
put
(
ApplicationMetricTable
.
COLUMN_TRANSACTION_CALLS
,
ApplicationMetricTable
.
COLUMN_TRANSACTION_CALLS
);
bucketsPathsMap
.
put
(
ApplicationMetricTable
.
COLUMN_TRANSACTION_ERROR_CALLS
,
ApplicationMetricTable
.
COLUMN_TRANSACTION_ERROR_CALLS
);
String
idOrCode
=
"(params."
+
ApplicationMetricTable
.
COLUMN_TRANSACTION_CALLS
+
" - params."
+
ApplicationMetricTable
.
COLUMN_TRANSACTION_ERROR_CALLS
+
")"
+
" / "
+
"("
+
betweenSecond
+
")"
;
Script
script
=
new
Script
(
idOrCode
);
aggregationBuilder
.
subAggregation
(
PipelineAggregatorBuilders
.
bucketScript
(
AVG_TPS
,
bucketsPathsMap
,
script
));
searchRequestBuilder
.
addAggregation
(
aggregationBuilder
);
SearchResponse
searchResponse
=
searchRequestBuilder
.
execute
().
actionGet
();
List
<
ApplicationTPS
>
applicationTPSs
=
new
LinkedList
<>();
Terms
serviceIdTerms
=
searchResponse
.
getAggregations
().
get
(
ApplicationMetricTable
.
COLUMN_APPLICATION_ID
);
serviceIdTerms
.
getBuckets
().
forEach
(
serviceIdTerm
->
{
int
applicationId
=
serviceIdTerm
.
getKeyAsNumber
().
intValue
();
ApplicationTPS
serviceMetric
=
new
ApplicationTPS
();
InternalSimpleValue
simpleValue
=
serviceIdTerm
.
getAggregations
().
get
(
AVG_TPS
);
serviceMetric
.
setApplicationId
(
applicationId
);
serviceMetric
.
setTps
((
int
)
simpleValue
.
getValue
());
applicationTPSs
.
add
(
serviceMetric
);
});
return
applicationTPSs
;
}
}
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/InstanceMetricEsUIDAO.java
浏览文件 @
e233b7be
...
...
@@ -58,7 +58,7 @@ public class InstanceMetricEsUIDAO extends EsDAO implements IInstanceMetricUIDAO
super
(
client
);
}
@Override
public
List
<
AppServerInfo
>
get
TopN
ServerThroughput
(
int
applicationId
,
Step
step
,
long
start
,
long
end
,
@Override
public
List
<
AppServerInfo
>
getServerThroughput
(
int
applicationId
,
Step
step
,
long
start
,
long
end
,
long
secondBetween
,
int
topN
,
MetricSource
metricSource
)
{
String
tableName
=
TimePyramidTableNameBuilder
.
build
(
step
,
InstanceMetricTable
.
TABLE
);
...
...
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ServiceMetricEsUIDAO.java
浏览文件 @
e233b7be
...
...
@@ -88,6 +88,29 @@ public class ServiceMetricEsUIDAO extends EsDAO implements IServiceMetricUIDAO {
return
trends
;
}
@Override
public
List
<
Integer
>
getServiceTPSTrend
(
int
serviceId
,
Step
step
,
List
<
DurationPoint
>
durationPoints
)
{
MultiGetRequestBuilder
prepareMultiGet
=
getClient
().
prepareMultiGet
();
String
tableName
=
TimePyramidTableNameBuilder
.
build
(
step
,
ServiceMetricTable
.
TABLE
);
durationPoints
.
forEach
(
durationPoint
->
{
String
id
=
durationPoint
.
getPoint
()
+
Const
.
ID_SPLIT
+
serviceId
+
Const
.
ID_SPLIT
+
MetricSource
.
Callee
.
getValue
();
prepareMultiGet
.
add
(
tableName
,
ServiceMetricTable
.
TABLE_TYPE
,
id
);
});
List
<
Integer
>
trends
=
new
LinkedList
<>();
MultiGetResponse
multiGetResponse
=
prepareMultiGet
.
get
();
for
(
MultiGetItemResponse
response
:
multiGetResponse
.
getResponses
())
{
if
(
response
.
getResponse
().
isExists
())
{
long
calls
=
((
Number
)
response
.
getResponse
().
getSource
().
get
(
ServiceMetricTable
.
COLUMN_TRANSACTION_CALLS
)).
longValue
();
long
errorCalls
=
((
Number
)
response
.
getResponse
().
getSource
().
get
(
ServiceMetricTable
.
COLUMN_TRANSACTION_ERROR_CALLS
)).
longValue
();
trends
.
add
((
int
)(
calls
-
errorCalls
));
}
else
{
trends
.
add
(
0
);
}
}
return
trends
;
}
@Override
public
List
<
Integer
>
getServiceSLATrend
(
int
serviceId
,
Step
step
,
List
<
DurationPoint
>
durationPoints
)
{
MultiGetRequestBuilder
prepareMultiGet
=
getClient
().
prepareMultiGet
();
String
tableName
=
TimePyramidTableNameBuilder
.
build
(
step
,
ServiceMetricTable
.
TABLE
);
...
...
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/StorageModuleH2Provider.java
浏览文件 @
e233b7be
...
...
@@ -109,6 +109,7 @@ import org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMin
import
org.apache.skywalking.apm.collector.storage.dao.srmp.IServiceReferenceMonthMetricPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationComponentUIDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMappingUIDAO
;
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.ICpuMetricUIDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.ui.IGCMetricUIDAO
;
...
...
@@ -207,6 +208,7 @@ import org.apache.skywalking.apm.collector.storage.h2.dao.srmp.ServiceReferenceM
import
org.apache.skywalking.apm.collector.storage.h2.dao.srmp.ServiceReferenceMonthMetricH2PersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.h2.dao.ui.ApplicationComponentH2UIDAO
;
import
org.apache.skywalking.apm.collector.storage.h2.dao.ui.ApplicationMappingH2UIDAO
;
import
org.apache.skywalking.apm.collector.storage.h2.dao.ui.ApplicationMetricH2UIDAO
;
import
org.apache.skywalking.apm.collector.storage.h2.dao.ui.ApplicationReferenceMetricH2UIDAO
;
import
org.apache.skywalking.apm.collector.storage.h2.dao.ui.CpuMetricH2UIDAO
;
import
org.apache.skywalking.apm.collector.storage.h2.dao.ui.GCMetricH2UIDAO
;
...
...
@@ -383,6 +385,7 @@ public class StorageModuleH2Provider extends ModuleProvider {
this
.
registerServiceImplementation
(
IInstanceMetricUIDAO
.
class
,
new
InstanceMetricH2UIDAO
(
h2Client
));
this
.
registerServiceImplementation
(
IApplicationComponentUIDAO
.
class
,
new
ApplicationComponentH2UIDAO
(
h2Client
));
this
.
registerServiceImplementation
(
IApplicationMappingUIDAO
.
class
,
new
ApplicationMappingH2UIDAO
(
h2Client
));
this
.
registerServiceImplementation
(
IApplicationMetricUIDAO
.
class
,
new
ApplicationMetricH2UIDAO
(
h2Client
));
this
.
registerServiceImplementation
(
IApplicationReferenceMetricUIDAO
.
class
,
new
ApplicationReferenceMetricH2UIDAO
(
h2Client
));
this
.
registerServiceImplementation
(
ISegmentDurationUIDAO
.
class
,
new
SegmentDurationH2UIDAO
(
h2Client
));
this
.
registerServiceImplementation
(
ISegmentUIDAO
.
class
,
new
SegmentH2UIDAO
(
h2Client
));
...
...
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ApplicationMetricH2UIDAO.java
0 → 100644
浏览文件 @
e233b7be
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.collector.storage.h2.dao.ui
;
import
java.util.List
;
import
org.apache.skywalking.apm.collector.client.h2.H2Client
;
import
org.apache.skywalking.apm.collector.storage.dao.ui.IApplicationMetricUIDAO
;
import
org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO
;
import
org.apache.skywalking.apm.collector.storage.table.MetricSource
;
import
org.apache.skywalking.apm.collector.storage.ui.common.Step
;
import
org.apache.skywalking.apm.collector.storage.ui.overview.ApplicationTPS
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationMetricH2UIDAO
extends
H2DAO
implements
IApplicationMetricUIDAO
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ApplicationMetricH2UIDAO
.
class
);
public
ApplicationMetricH2UIDAO
(
H2Client
client
)
{
super
(
client
);
}
@Override
public
List
<
ApplicationTPS
>
getTopNApplicationThroughput
(
Step
step
,
long
start
,
long
end
,
long
betweenSecond
,
int
topN
,
MetricSource
metricSource
)
{
return
null
;
}
}
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/InstanceMetricH2UIDAO.java
浏览文件 @
e233b7be
...
...
@@ -49,7 +49,7 @@ public class InstanceMetricH2UIDAO extends H2DAO implements IInstanceMetricUIDAO
super
(
client
);
}
@Override
public
List
<
AppServerInfo
>
get
TopN
ServerThroughput
(
int
applicationId
,
Step
step
,
long
start
,
long
end
,
@Override
public
List
<
AppServerInfo
>
getServerThroughput
(
int
applicationId
,
Step
step
,
long
start
,
long
end
,
long
secondBetween
,
int
topN
,
MetricSource
metricSource
)
{
return
null
;
}
...
...
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ServiceMetricH2UIDAO.java
浏览文件 @
e233b7be
...
...
@@ -80,6 +80,10 @@ public class ServiceMetricH2UIDAO extends H2DAO implements IServiceMetricUIDAO {
return
trends
;
}
@Override
public
List
<
Integer
>
getServiceTPSTrend
(
int
serviceId
,
Step
step
,
List
<
DurationPoint
>
durationPoints
)
{
return
null
;
}
@Override
public
List
<
Integer
>
getServiceSLATrend
(
int
serviceId
,
Step
step
,
List
<
DurationPoint
>
durationPoints
)
{
String
tableName
=
TimePyramidTableNameBuilder
.
build
(
step
,
ServiceMetricTable
.
TABLE
);
...
...
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ApplicationQuery.java
浏览文件 @
e233b7be
...
...
@@ -30,6 +30,7 @@ import org.apache.skywalking.apm.collector.storage.ui.service.ServiceMetric;
import
org.apache.skywalking.apm.collector.ui.graphql.Query
;
import
org.apache.skywalking.apm.collector.ui.service.ApplicationService
;
import
org.apache.skywalking.apm.collector.ui.service.ApplicationTopologyService
;
import
org.apache.skywalking.apm.collector.ui.service.ServerService
;
import
org.apache.skywalking.apm.collector.ui.utils.DurationUtils
;
/**
...
...
@@ -40,6 +41,7 @@ public class ApplicationQuery implements Query {
private
final
ModuleManager
moduleManager
;
private
ApplicationService
applicationService
;
private
ApplicationTopologyService
applicationTopologyService
;
private
ServerService
serverService
;
public
ApplicationQuery
(
ModuleManager
moduleManager
)
{
this
.
moduleManager
=
moduleManager
;
...
...
@@ -59,6 +61,13 @@ public class ApplicationQuery implements Query {
return
applicationTopologyService
;
}
private
ServerService
getServerService
()
{
if
(
ObjectUtils
.
isEmpty
(
serverService
))
{
this
.
serverService
=
new
ServerService
(
moduleManager
);
}
return
serverService
;
}
public
List
<
Application
>
getAllApplication
(
Duration
duration
)
throws
ParseException
{
long
start
=
DurationUtils
.
INSTANCE
.
durationToSecondTimeBucket
(
duration
.
getStep
(),
duration
.
getStart
());
long
end
=
DurationUtils
.
INSTANCE
.
durationToSecondTimeBucket
(
duration
.
getStep
(),
duration
.
getEnd
());
...
...
@@ -73,14 +82,19 @@ public class ApplicationQuery implements Query {
return
getApplicationTopologyService
().
getApplicationTopology
(
duration
.
getStep
(),
applicationId
,
start
,
end
);
}
public
List
<
ServiceMetric
>
getSlowService
(
int
applicationId
,
Duration
duration
,
Integer
top
)
throws
ParseException
{
public
List
<
ServiceMetric
>
getSlowService
(
int
applicationId
,
Duration
duration
,
Integer
topN
)
throws
ParseException
{
long
start
=
DurationUtils
.
INSTANCE
.
exchangeToTimeBucket
(
duration
.
getStart
());
long
end
=
DurationUtils
.
INSTANCE
.
exchangeToTimeBucket
(
duration
.
getEnd
());
return
getApplicationService
().
getSlowService
(
applicationId
,
duration
.
getStep
(),
start
,
end
,
top
);
return
getApplicationService
().
getSlowService
(
applicationId
,
duration
.
getStep
(),
start
,
end
,
top
N
);
}
public
List
<
AppServerInfo
>
getServerThroughput
(
int
applicationId
,
Duration
duration
,
Integer
top
)
{
return
null
;
public
List
<
AppServerInfo
>
getServerThroughput
(
int
applicationId
,
Duration
duration
,
Integer
topN
)
throws
ParseException
{
long
start
=
DurationUtils
.
INSTANCE
.
exchangeToTimeBucket
(
duration
.
getStart
());
long
end
=
DurationUtils
.
INSTANCE
.
exchangeToTimeBucket
(
duration
.
getEnd
());
return
getServerService
().
getServerThroughput
(
applicationId
,
duration
.
getStep
(),
start
,
end
,
topN
);
}
}
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/OverViewLayerQuery.java
浏览文件 @
e233b7be
...
...
@@ -25,16 +25,15 @@ import org.apache.skywalking.apm.collector.core.util.ObjectUtils;
import
org.apache.skywalking.apm.collector.storage.ui.common.Duration
;
import
org.apache.skywalking.apm.collector.storage.ui.common.Topology
;
import
org.apache.skywalking.apm.collector.storage.ui.overview.AlarmTrend
;
import
org.apache.skywalking.apm.collector.storage.ui.overview.ApplicationTPS
;
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.ServiceMetric
;
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
;
import
org.apache.skywalking.apm.collector.ui.service.ClusterTopologyService
;
import
org.apache.skywalking.apm.collector.ui.service.NetworkAddressService
;
import
org.apache.skywalking.apm.collector.ui.service.ServerService
;
import
org.apache.skywalking.apm.collector.ui.service.ServiceNameService
;
import
org.apache.skywalking.apm.collector.ui.utils.DurationUtils
;
...
...
@@ -48,7 +47,6 @@ public class OverViewLayerQuery implements Query {
private
ApplicationService
applicationService
;
private
NetworkAddressService
networkAddressService
;
private
ServiceNameService
serviceNameService
;
private
ServerService
serverService
;
private
AlarmService
alarmService
;
public
OverViewLayerQuery
(
ModuleManager
moduleManager
)
{
...
...
@@ -90,13 +88,6 @@ public class OverViewLayerQuery implements Query {
return
alarmService
;
}
private
ServerService
getServerService
()
{
if
(
ObjectUtils
.
isEmpty
(
serverService
))
{
this
.
serverService
=
new
ServerService
(
moduleManager
);
}
return
serverService
;
}
public
Topology
getClusterTopology
(
Duration
duration
)
throws
ParseException
{
long
start
=
DurationUtils
.
INSTANCE
.
durationToSecondTimeBucket
(
duration
.
getStep
(),
duration
.
getStart
());
long
end
=
DurationUtils
.
INSTANCE
.
durationToSecondTimeBucket
(
duration
.
getStep
(),
duration
.
getEnd
());
...
...
@@ -135,11 +126,11 @@ public class OverViewLayerQuery implements Query {
return
getServiceNameService
().
getSlowService
(
duration
.
getStep
(),
start
,
end
,
topN
);
}
public
List
<
App
ServerInfo
>
getTopNServerThroughput
(
int
applicationId
,
Duration
duration
,
public
List
<
App
licationTPS
>
getTopNApplicationThroughput
(
Duration
duration
,
int
topN
)
throws
ParseException
{
long
start
=
DurationUtils
.
INSTANCE
.
exchangeToTimeBucket
(
duration
.
getStart
());
long
end
=
DurationUtils
.
INSTANCE
.
exchangeToTimeBucket
(
duration
.
getEnd
());
return
get
ServerService
().
getTopNServerThroughput
(
applicationId
,
duration
.
getStep
(),
start
,
end
,
topN
);
return
get
ApplicationService
().
getTopNApplicationThroughput
(
duration
.
getStep
(),
start
,
end
,
topN
);
}
}
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/ServiceQuery.java
浏览文件 @
e233b7be
...
...
@@ -70,8 +70,11 @@ public class ServiceQuery implements Query {
return
getServiceNameService
().
getServiceResponseTimeTrend
(
serviceId
,
duration
.
getStep
(),
start
,
end
);
}
public
ThroughputTrend
getServiceTPSTrend
(
int
serviceId
,
Duration
duration
)
{
return
null
;
public
ThroughputTrend
getServiceTPSTrend
(
int
serviceId
,
Duration
duration
)
throws
ParseException
{
long
start
=
DurationUtils
.
INSTANCE
.
exchangeToTimeBucket
(
duration
.
getStart
());
long
end
=
DurationUtils
.
INSTANCE
.
exchangeToTimeBucket
(
duration
.
getEnd
());
return
getServiceNameService
().
getServiceTPSTrend
(
serviceId
,
duration
.
getStep
(),
start
,
end
);
}
public
SLATrend
getServiceSLATrend
(
int
serviceId
,
Duration
duration
)
throws
ParseException
{
...
...
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationService.java
浏览文件 @
e233b7be
...
...
@@ -25,11 +25,13 @@ import org.apache.skywalking.apm.collector.cache.service.ApplicationCacheService
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.IApplicationMetricUIDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.ui.IInstanceUIDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.ui.IServiceMetricUIDAO
;
import
org.apache.skywalking.apm.collector.storage.table.MetricSource
;
import
org.apache.skywalking.apm.collector.storage.ui.application.Application
;
import
org.apache.skywalking.apm.collector.storage.ui.common.Step
;
import
org.apache.skywalking.apm.collector.storage.ui.overview.ApplicationTPS
;
import
org.apache.skywalking.apm.collector.storage.ui.service.ServiceMetric
;
/**
...
...
@@ -39,12 +41,14 @@ public class ApplicationService {
private
final
IInstanceUIDAO
instanceDAO
;
private
final
IServiceMetricUIDAO
serviceMetricUIDAO
;
private
final
IApplicationMetricUIDAO
applicationMetricUIDAO
;
private
final
ApplicationCacheService
applicationCacheService
;
private
final
ServiceNameCacheService
serviceNameCacheService
;
public
ApplicationService
(
ModuleManager
moduleManager
)
{
this
.
instanceDAO
=
moduleManager
.
find
(
StorageModule
.
NAME
).
getService
(
IInstanceUIDAO
.
class
);
this
.
serviceMetricUIDAO
=
moduleManager
.
find
(
StorageModule
.
NAME
).
getService
(
IServiceMetricUIDAO
.
class
);
this
.
applicationMetricUIDAO
=
moduleManager
.
find
(
StorageModule
.
NAME
).
getService
(
IApplicationMetricUIDAO
.
class
);
this
.
applicationCacheService
=
moduleManager
.
find
(
CacheModule
.
NAME
).
getService
(
ApplicationCacheService
.
class
);
this
.
serviceNameCacheService
=
moduleManager
.
find
(
CacheModule
.
NAME
).
getService
(
ServiceNameCacheService
.
class
);
}
...
...
@@ -69,4 +73,15 @@ public class ApplicationService {
});
return
slowServices
;
}
public
List
<
ApplicationTPS
>
getTopNApplicationThroughput
(
Step
step
,
long
start
,
long
end
,
int
topN
)
throws
ParseException
{
//TODO
List
<
ApplicationTPS
>
applicationThroughput
=
applicationMetricUIDAO
.
getTopNApplicationThroughput
(
step
,
start
,
end
,
1000
,
topN
,
MetricSource
.
Callee
);
applicationThroughput
.
forEach
(
applicationTPS
->
{
String
applicationCode
=
applicationCacheService
.
getApplicationById
(
applicationTPS
.
getApplicationId
()).
getApplicationCode
();
applicationTPS
.
setApplicationCode
(
applicationCode
);
});
return
applicationThroughput
;
}
}
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServerService.java
浏览文件 @
e233b7be
...
...
@@ -72,18 +72,6 @@ public class ServerService {
this
.
applicationCacheService
=
moduleManager
.
find
(
CacheModule
.
NAME
).
getService
(
ApplicationCacheService
.
class
);
}
public
List
<
AppServerInfo
>
getTopNServerThroughput
(
int
applicationId
,
Step
step
,
long
start
,
long
end
,
int
topN
)
{
//TODO
List
<
AppServerInfo
>
appServerInfos
=
instanceMetricUIDAO
.
getTopNServerThroughput
(
applicationId
,
step
,
start
,
end
,
1000
,
topN
,
MetricSource
.
Callee
);
appServerInfos
.
forEach
(
appServerInfo
->
{
Instance
instance
=
instanceUIDAO
.
getInstance
(
appServerInfo
.
getId
());
appServerInfo
.
setOsInfo
(
instance
.
getOsInfo
());
});
buildAppServerInfo
(
appServerInfos
);
return
appServerInfos
;
}
public
List
<
AppServerInfo
>
searchServer
(
String
keyword
,
long
start
,
long
end
)
{
List
<
AppServerInfo
>
serverInfos
=
instanceUIDAO
.
searchServer
(
keyword
,
start
,
end
);
serverInfos
.
forEach
(
serverInfo
->
{
...
...
@@ -111,6 +99,21 @@ public class ServerService {
return
responseTimeTrend
;
}
public
List
<
AppServerInfo
>
getServerThroughput
(
int
applicationId
,
Step
step
,
long
start
,
long
end
,
Integer
topN
)
throws
ParseException
{
//TODO
List
<
AppServerInfo
>
serverThroughput
=
instanceMetricUIDAO
.
getServerThroughput
(
applicationId
,
step
,
start
,
end
,
1000
,
topN
,
MetricSource
.
Callee
);
serverThroughput
.
forEach
(
appServerInfo
->
{
String
applicationCode
=
applicationCacheService
.
getApplicationById
(
applicationId
).
getApplicationCode
();
appServerInfo
.
setApplicationCode
(
applicationCode
);
Instance
instance
=
instanceUIDAO
.
getInstance
(
appServerInfo
.
getId
());
appServerInfo
.
setOsInfo
(
instance
.
getOsInfo
());
});
buildAppServerInfo
(
serverThroughput
);
return
serverThroughput
;
}
public
ThroughputTrend
getServerTPSTrend
(
int
instanceId
,
Step
step
,
long
start
,
long
end
)
throws
ParseException
{
ThroughputTrend
throughputTrend
=
new
ThroughputTrend
();
List
<
DurationPoint
>
durationPoints
=
DurationUtils
.
INSTANCE
.
getDurationPoints
(
step
,
start
,
end
);
...
...
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServiceNameService.java
浏览文件 @
e233b7be
...
...
@@ -30,6 +30,7 @@ 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.common.ThroughputTrend
;
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
;
...
...
@@ -58,6 +59,17 @@ public class ServiceNameService {
return
serviceNameServiceUIDAO
.
searchService
(
keyword
,
topN
);
}
public
ThroughputTrend
getServiceTPSTrend
(
int
serviceId
,
Step
step
,
long
start
,
long
end
)
throws
ParseException
{
ThroughputTrend
throughputTrend
=
new
ThroughputTrend
();
List
<
DurationPoint
>
durationPoints
=
DurationUtils
.
INSTANCE
.
getDurationPoints
(
step
,
start
,
end
);
List
<
Integer
>
callsTrends
=
serviceMetricUIDAO
.
getServiceTPSTrend
(
serviceId
,
step
,
durationPoints
);
//TODO
callsTrends
.
forEach
(
calls
->
throughputTrend
.
getTrendList
().
add
(
calls
/
1000
));
return
throughputTrend
;
}
public
ResponseTimeTrend
getServiceResponseTimeTrend
(
int
serviceId
,
Step
step
,
long
start
,
long
end
)
throws
ParseException
{
ResponseTimeTrend
responseTimeTrend
=
new
ResponseTimeTrend
();
...
...
apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/application-layer.graphqls
浏览文件 @
e233b7be
...
...
@@ -43,6 +43,6 @@ type Application {
extend type Query {
getAllApplication(duration: Duration!): [Application!]!
getApplicationTopology(applicationId: ID!, duration: Duration!): Topology
getSlowService(applicationId: ID!, duration: Duration!, top: Int!): [ServiceMetric!]!
getServerThroughput(applicationId: ID!, duration: Duration!, top: Int!): [AppServerInfo!]!
getSlowService(applicationId: ID!, duration: Duration!, top
N
: Int!): [ServiceMetric!]!
getServerThroughput(applicationId: ID!, duration: Duration!, top
N
: Int!): [AppServerInfo!]!
}
apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/overview-layer.graphqls
浏览文件 @
e233b7be
...
...
@@ -27,11 +27,17 @@ type ConjecturalApp {
num: Int!
}
type ApplicationTPS {
applicationId: Int!
applicationCode: String
tps: Int!
}
extend type Query {
getClusterTopology(duration: Duration!): Topology
getClusterBrief(duration: Duration!): ClusterBrief
getAlarmTrend(duration: Duration!): AlarmTrend
getConjecturalApps(duration: Duration!): ConjecturalAppBrief
getTopNSlowService(duration: Duration!, topN: Int!): [ServiceMetric!]!
getTopN
ServerThroughput(applicationId: Int, duration: Duration!, topN: Int!): [AppServerInfo
!]!
getTopN
ApplicationThroughput(duration: Duration!, topN: Int!): [ApplicationTPS
!]!
}
apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/server-layer.graphqls
浏览文件 @
e233b7be
...
...
@@ -7,7 +7,7 @@ type AppServerInfo {
id: ID!
name: String!
applicationId: Int!
application
Nam
e: String
application
Cod
e: String
tps: Int!
host: String
pid: Int
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录