Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
SkyWalking
提交
0c9686e4
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 搜索 >>
提交
0c9686e4
编写于
2月 10, 2018
作者:
P
peng-yongsheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Provide the getServiceTPSTrend query.
上级
4419bca4
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
51 addition
and
2 deletion
+51
-2
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-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/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/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/ServiceNameService.java
...ywalking/apm/collector/ui/service/ServiceNameService.java
+12
-0
未找到文件。
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/IServiceMetricUIDAO.java
浏览文件 @
0c9686e4
...
...
@@ -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
浏览文件 @
0c9686e4
...
...
@@ -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-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/ServiceMetricEsUIDAO.java
浏览文件 @
0c9686e4
...
...
@@ -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/dao/ui/ServiceMetricH2UIDAO.java
浏览文件 @
0c9686e4
...
...
@@ -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/ServiceQuery.java
浏览文件 @
0c9686e4
...
...
@@ -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/ServiceNameService.java
浏览文件 @
0c9686e4
...
...
@@ -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
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录