Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
javalover123888
SkyWalking
提交
2caa29a0
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,发现更多精彩内容 >>
提交
2caa29a0
编写于
2月 28, 2018
作者:
P
peng-yongsheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1. Changed the attribute name from TPS to callsPerSec.
2. Calculate the callsPerSec.
上级
e90cfc8d
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
50 addition
and
22 deletion
+50
-22
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
-2
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/service/ServiceMetric.java
...lking/apm/collector/storage/ui/service/ServiceMetric.java
+14
-5
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
+7
-3
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
+1
-1
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
+6
-3
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
+1
-1
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
+18
-6
apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/service-layer.graphqls
...ocol/src/main/resources/ui-graphql/service-layer.graphqls
+1
-1
未找到文件。
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IServiceMetricUIDAO.java
浏览文件 @
2caa29a0
...
...
@@ -40,6 +40,6 @@ public interface IServiceMetricUIDAO extends DAO {
List
<
Node
>
getServicesMetric
(
Step
step
,
long
startTime
,
long
endTime
,
MetricSource
metricSource
,
Collection
<
Integer
>
serviceIds
);
List
<
ServiceMetric
>
getSlowService
(
int
applicationId
,
Step
step
,
long
start
,
long
end
,
Integer
top
,
MetricSource
metricSource
);
List
<
ServiceMetric
>
getSlowService
(
int
applicationId
,
Step
step
,
long
start
TimeBucket
,
long
endTimeBucket
,
Integer
top
N
,
MetricSource
metricSource
);
}
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/service/ServiceMetric.java
浏览文件 @
2caa29a0
...
...
@@ -24,8 +24,9 @@ package org.apache.skywalking.apm.collector.storage.ui.service;
public
class
ServiceMetric
{
private
int
id
;
private
String
name
;
private
long
calls
;
private
int
avgResponseTime
;
private
int
tps
;
private
int
callsPerSec
;
public
int
getId
()
{
return
id
;
...
...
@@ -51,11 +52,19 @@ public class ServiceMetric {
this
.
avgResponseTime
=
avgResponseTime
;
}
public
int
get
Tps
()
{
return
tps
;
public
int
get
CallsPerSec
()
{
return
callsPerSec
;
}
public
void
setTps
(
int
tps
)
{
this
.
tps
=
tps
;
public
void
setCallsPerSec
(
int
callsPerSec
)
{
this
.
callsPerSec
=
callsPerSec
;
}
public
long
getCalls
()
{
return
calls
;
}
public
void
setCalls
(
long
calls
)
{
this
.
calls
=
calls
;
}
}
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ServiceMetricEsUIDAO.java
浏览文件 @
2caa29a0
...
...
@@ -175,7 +175,9 @@ public class ServiceMetricEsUIDAO extends EsDAO implements IServiceMetricUIDAO {
return
nodes
;
}
@Override
public
List
<
ServiceMetric
>
getSlowService
(
int
applicationId
,
Step
step
,
long
start
,
long
end
,
Integer
top
,
@Override
public
List
<
ServiceMetric
>
getSlowService
(
int
applicationId
,
Step
step
,
long
startTimeBucket
,
long
endTimeBucket
,
Integer
topN
,
MetricSource
metricSource
)
{
String
tableName
=
TimePyramidTableNameBuilder
.
build
(
step
,
ServiceMetricTable
.
TABLE
);
...
...
@@ -184,7 +186,7 @@ public class ServiceMetricEsUIDAO extends EsDAO implements IServiceMetricUIDAO {
searchRequestBuilder
.
setSearchType
(
SearchType
.
DFS_QUERY_THEN_FETCH
);
BoolQueryBuilder
boolQuery
=
QueryBuilders
.
boolQuery
();
boolQuery
.
must
().
add
(
QueryBuilders
.
rangeQuery
(
ServiceMetricTable
.
COLUMN_TIME_BUCKET
).
gte
(
start
).
lte
(
end
));
boolQuery
.
must
().
add
(
QueryBuilders
.
rangeQuery
(
ServiceMetricTable
.
COLUMN_TIME_BUCKET
).
gte
(
start
TimeBucket
).
lte
(
endTimeBucket
));
if
(
applicationId
!=
0
)
{
boolQuery
.
must
().
add
(
QueryBuilders
.
termQuery
(
ServiceMetricTable
.
COLUMN_APPLICATION_ID
,
applicationId
));
}
...
...
@@ -193,7 +195,7 @@ public class ServiceMetricEsUIDAO extends EsDAO implements IServiceMetricUIDAO {
searchRequestBuilder
.
setQuery
(
boolQuery
);
searchRequestBuilder
.
setSize
(
0
);
TermsAggregationBuilder
aggregationBuilder
=
AggregationBuilders
.
terms
(
ServiceMetricTable
.
COLUMN_SERVICE_ID
).
field
(
ServiceMetricTable
.
COLUMN_SERVICE_ID
).
size
(
top
);
TermsAggregationBuilder
aggregationBuilder
=
AggregationBuilders
.
terms
(
ServiceMetricTable
.
COLUMN_SERVICE_ID
).
field
(
ServiceMetricTable
.
COLUMN_SERVICE_ID
).
size
(
top
N
);
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
));
...
...
@@ -221,7 +223,9 @@ public class ServiceMetricEsUIDAO extends EsDAO implements IServiceMetricUIDAO {
ServiceMetric
serviceMetric
=
new
ServiceMetric
();
InternalSimpleValue
simpleValue
=
serviceIdTerm
.
getAggregations
().
get
(
AVG_DURATION
);
Sum
calls
=
serviceIdTerm
.
getAggregations
().
get
(
ServiceMetricTable
.
COLUMN_TRANSACTION_CALLS
);
serviceMetric
.
setCalls
((
long
)
calls
.
getValue
());
serviceMetric
.
setId
(
serviceId
);
serviceMetric
.
setAvgResponseTime
((
int
)
simpleValue
.
getValue
());
serviceMetrics
.
add
(
serviceMetric
);
...
...
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/ServiceMetricH2UIDAO.java
浏览文件 @
2caa29a0
...
...
@@ -116,7 +116,7 @@ public class ServiceMetricH2UIDAO extends H2DAO implements IServiceMetricUIDAO {
return
null
;
}
@Override
public
List
<
ServiceMetric
>
getSlowService
(
int
applicationId
,
Step
step
,
long
start
,
long
end
,
Integer
top
,
@Override
public
List
<
ServiceMetric
>
getSlowService
(
int
applicationId
,
Step
step
,
long
start
TimeBucket
,
long
endTimeBucket
,
Integer
topN
,
MetricSource
metricSource
)
{
return
null
;
}
...
...
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/OverViewLayerQuery.java
浏览文件 @
2caa29a0
...
...
@@ -146,10 +146,13 @@ public class OverViewLayerQuery implements Query {
}
public
List
<
ServiceMetric
>
getTopNSlowService
(
Duration
duration
,
int
topN
)
throws
ParseException
{
long
start
=
DurationUtils
.
INSTANCE
.
exchangeToTimeBucket
(
duration
.
getStart
());
long
end
=
DurationUtils
.
INSTANCE
.
exchangeToTimeBucket
(
duration
.
getEnd
());
long
startTimeBucket
=
DurationUtils
.
INSTANCE
.
exchangeToTimeBucket
(
duration
.
getStart
());
long
endTimeBucket
=
DurationUtils
.
INSTANCE
.
exchangeToTimeBucket
(
duration
.
getEnd
());
long
startSecondTimeBucket
=
DurationUtils
.
INSTANCE
.
durationToSecondTimeBucket
(
duration
.
getStep
(),
duration
.
getStart
());
long
endSecondTimeBucket
=
DurationUtils
.
INSTANCE
.
durationToSecondTimeBucket
(
duration
.
getStep
(),
duration
.
getEnd
());
return
getServiceNameService
().
getSlowService
(
duration
.
getStep
(),
start
,
end
,
topN
);
return
getServiceNameService
().
getSlowService
(
duration
.
getStep
(),
start
TimeBucket
,
endTimeBucket
,
startSecondTimeBucket
,
endSecondTimeBucket
,
topN
);
}
public
List
<
ApplicationTPS
>
getTopNApplicationThroughput
(
Duration
duration
,
...
...
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ApplicationService.java
浏览文件 @
2caa29a0
...
...
@@ -75,7 +75,7 @@ public class ApplicationService {
slowServices
.
forEach
(
slowService
->
{
slowService
.
setName
(
serviceNameCacheService
.
get
(
slowService
.
getId
()).
getServiceName
());
//TODO
slowService
.
set
Tps
(
1
);
slowService
.
set
CallsPerSec
(
1
);
});
return
slowServices
;
}
...
...
apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServiceNameService.java
浏览文件 @
2caa29a0
...
...
@@ -27,6 +27,7 @@ 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.table.register.ServiceName
;
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
;
...
...
@@ -35,20 +36,26 @@ 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
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* @author peng-yongsheng
*/
public
class
ServiceNameService
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ServiceNameService
.
class
);
private
final
IServiceNameServiceUIDAO
serviceNameServiceUIDAO
;
private
final
IServiceMetricUIDAO
serviceMetricUIDAO
;
private
final
ServiceNameCacheService
serviceNameCacheService
;
private
final
SecondBetweenService
secondBetweenService
;
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
);
this
.
secondBetweenService
=
new
SecondBetweenService
(
moduleManager
);
}
public
int
getCount
()
{
...
...
@@ -85,13 +92,18 @@ public class ServiceNameService {
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
);
public
List
<
ServiceMetric
>
getSlowService
(
Step
step
,
long
startTimeBucket
,
long
endTimeBucket
,
long
startSecondTimeBucket
,
long
endSecondTimeBucket
,
Integer
topN
)
throws
ParseException
{
List
<
ServiceMetric
>
slowServices
=
serviceMetricUIDAO
.
getSlowService
(
0
,
step
,
startTimeBucket
,
endTimeBucket
,
topN
,
MetricSource
.
Callee
);
slowServices
.
forEach
(
slowService
->
{
slowService
.
setName
(
serviceNameCacheService
.
get
(
slowService
.
getId
()).
getServiceName
());
//TODO
slowService
.
setTps
(
1
);
ServiceName
serviceName
=
serviceNameCacheService
.
get
(
slowService
.
getId
());
slowService
.
setName
(
serviceName
.
getServiceName
());
try
{
slowService
.
setCallsPerSec
((
int
)(
slowService
.
getCalls
()
/
secondBetweenService
.
calculate
(
serviceName
.
getApplicationId
(),
startSecondTimeBucket
,
endSecondTimeBucket
)));
}
catch
(
ParseException
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
}
});
return
slowServices
;
}
...
...
apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/service-layer.graphqls
浏览文件 @
2caa29a0
...
...
@@ -21,7 +21,7 @@ type ServiceMetric {
name: String
# The unit is millisecond.
avgResponseTime: Int!
tps
: Int!
callsPerSec
: Int!
}
type TraceItem {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录