Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
润土的好友猹
SkyWalking
提交
c95a9134
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
c95a9134
编写于
10月 29, 2020
作者:
H
Humbertzhang
提交者:
GitHub
10月 29, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add percentile tests in e2e test. (#5737)
上级
2aeefcec
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
127 addition
and
24 deletion
+127
-24
test/e2e/e2e-service-consumer/src/main/java/org/apache/skywalking/e2e/controller/UserController.java
.../org/apache/skywalking/e2e/controller/UserController.java
+13
-2
test/e2e/e2e-service-provider/src/main/java/org/apache/skywalking/e2e/controller/UserController.java
.../org/apache/skywalking/e2e/controller/UserController.java
+14
-2
test/e2e/e2e-service-provider/src/main/java/org/apache/skywalking/e2e/lua/LuaController.java
...ain/java/org/apache/skywalking/e2e/lua/LuaController.java
+4
-1
test/e2e/e2e-test/docker/go/Dockerfile.go
test/e2e/e2e-test/docker/go/Dockerfile.go
+1
-1
test/e2e/e2e-test/docker/lua/Dockerfile.nginx
test/e2e/e2e-test/docker/lua/Dockerfile.nginx
+1
-1
test/e2e/e2e-test/docker/lua/nginx.conf
test/e2e/e2e-test/docker/lua/nginx.conf
+5
-5
test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/GOE2E.java
...e-test/src/test/java/org/apache/skywalking/e2e/GOE2E.java
+9
-0
test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/GatewayE2E.java
...t/src/test/java/org/apache/skywalking/e2e/GatewayE2E.java
+9
-0
test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/LuaE2E.java
...-test/src/test/java/org/apache/skywalking/e2e/LuaE2E.java
+9
-0
test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/PHPE2E.java
...-test/src/test/java/org/apache/skywalking/e2e/PHPE2E.java
+9
-0
test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/PythonE2E.java
...st/src/test/java/org/apache/skywalking/e2e/PythonE2E.java
+10
-0
test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/kafka/KafkaE2E.java
...c/test/java/org/apache/skywalking/e2e/kafka/KafkaE2E.java
+10
-0
test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/simple/SimpleE2E.java
...test/java/org/apache/skywalking/e2e/simple/SimpleE2E.java
+21
-11
test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/storage/StorageE2E.java
...st/java/org/apache/skywalking/e2e/storage/StorageE2E.java
+11
-0
test/e2e/e2e-test/src/test/resources/expected/go/topo.yml
test/e2e/e2e-test/src/test/resources/expected/go/topo.yml
+1
-1
未找到文件。
test/e2e/e2e-service-consumer/src/main/java/org/apache/skywalking/e2e/controller/UserController.java
浏览文件 @
c95a9134
...
...
@@ -20,6 +20,7 @@ package org.apache.skywalking.e2e.controller;
import
com.google.common.base.Strings
;
import
java.util.Optional
;
import
java.util.Random
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -38,9 +39,13 @@ public class UserController {
private
final
E2EConfiguration
configuration
;
private
final
int
sleepMin
=
500
;
private
final
int
sleepMax
=
1000
;
@PostMapping
(
"/info"
)
public
String
info
()
throws
InterruptedException
{
Thread
.
sleep
(
1000L
);
Thread
.
sleep
(
randomSleepLong
(
sleepMin
,
sleepMax
)
);
Optional
<
ResponseEntity
<
String
>>
optionalResponseEntity
=
Stream
.
of
(
Strings
.
nullToEmpty
(
configuration
.
getProviderBaseUrl
()).
split
(
","
))
...
...
@@ -55,10 +60,16 @@ public class UserController {
@PostMapping
(
"/users"
)
public
Object
createAuthor
(
@RequestBody
final
User
user
)
throws
InterruptedException
{
Thread
.
sleep
(
1000L
);
Thread
.
sleep
(
randomSleepLong
(
sleepMin
,
sleepMax
)
);
return
Stream
.
of
(
Strings
.
nullToEmpty
(
configuration
.
getProviderBaseUrl
()).
split
(
","
))
.
map
(
baseUrl
->
restTemplate
.
postForEntity
(
baseUrl
+
"/users"
,
user
,
User
.
class
))
.
collect
(
Collectors
.
toList
());
}
private
long
randomSleepLong
(
int
min
,
int
max
)
{
Random
rand
=
new
Random
();
int
randomNumber
=
rand
.
nextInt
((
max
-
min
)
+
1
)
+
min
;
return
randomNumber
;
}
}
test/e2e/e2e-service-provider/src/main/java/org/apache/skywalking/e2e/controller/UserController.java
浏览文件 @
c95a9134
...
...
@@ -25,19 +25,31 @@ import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Random
;
@RestController
@RequiredArgsConstructor
@SuppressWarnings
(
"SameReturnValue"
)
public
class
UserController
{
private
final
UserRepo
userRepo
;
private
final
int
sleepMin
=
500
;
private
final
int
sleepMax
=
1000
;
@PostMapping
(
"/info"
)
public
String
info
()
{
public
String
info
()
throws
InterruptedException
{
Thread
.
sleep
(
randomSleepLong
(
sleepMin
,
sleepMax
));
return
"whatever"
;
}
@PostMapping
(
"/users"
)
public
User
createAuthor
(
@RequestBody
final
User
user
)
{
public
User
createAuthor
(
@RequestBody
final
User
user
)
throws
InterruptedException
{
Thread
.
sleep
(
randomSleepLong
(
sleepMin
,
sleepMax
));
return
userRepo
.
save
(
user
);
}
private
long
randomSleepLong
(
int
min
,
int
max
)
{
Random
rand
=
new
Random
();
int
randomNumber
=
rand
.
nextInt
((
max
-
min
)
+
1
)
+
min
;
return
randomNumber
;
}
}
test/e2e/e2e-service-provider/src/main/java/org/apache/skywalking/e2e/lua/LuaController.java
浏览文件 @
c95a9134
...
...
@@ -28,6 +28,7 @@ import org.springframework.web.client.RestTemplate;
import
java.net.MalformedURLException
;
import
java.net.URISyntaxException
;
import
java.net.URL
;
import
java.util.concurrent.TimeUnit
;
@RestController
@RequiredArgsConstructor
...
...
@@ -43,7 +44,9 @@ public class LuaController {
}
@PostMapping
(
"/nginx/end/info"
)
private
String
nginxEnd
()
throws
MalformedURLException
,
URISyntaxException
{
private
String
nginxEnd
()
throws
InterruptedException
{
TimeUnit
.
SECONDS
.
sleep
(
1
);
return
TraceContext
.
getCorrelation
(
"entry"
).
orElse
(
""
)
+
"_"
+
TraceContext
.
getCorrelation
(
"nginx"
).
orElse
(
""
);
}
...
...
test/e2e/e2e-test/docker/go/Dockerfile.go
浏览文件 @
c95a9134
...
...
@@ -15,7 +15,7 @@
FROM
golang
:
1.12
AS
builder
ARG
COMMIT_HASH
=
140002
c944931ebc0e8e1ea6f7dca128108cf4e7
ARG
COMMIT_HASH
=
38
c3b84741dd6c0609965e9df0fcc633915d3ea5
ARG
GO2SKY_CODE
=
$
{
COMMIT_HASH
}
.
tar
.
gz
ARG
GO2SKY_CODE_URL
=
https
:
//github.com/SkyAPM/go2sky/archive/${GO2SKY_CODE}
...
...
test/e2e/e2e-test/docker/lua/Dockerfile.nginx
浏览文件 @
c95a9134
...
...
@@ -15,7 +15,7 @@
FROM openresty/openresty
ENV COMMIT_HASH=
b4700215abf5797279e7613ab96d8141a89d0b48
ENV COMMIT_HASH=
cda47ae0a507ab86a378a298325c3c94d9a773c2
WORKDIR /usr/share/skywalking-nginx-lua
...
...
test/e2e/e2e-test/docker/lua/nginx.conf
浏览文件 @
c95a9134
...
...
@@ -23,7 +23,7 @@ events {
http
{
resolver
local=on
ipv6=off
;
lua_package_path
"/usr/share/skywalking-nginx-lua/lib/
skywalking/
?.lua
;
;
"
;
lua_package_path
"/usr/share/skywalking-nginx-lua/lib/?.lua
;
;
"
;
# Buffer represents the register inform and the queue of the finished segment
lua_shared_dict
tracing_buffer
100m
;
...
...
@@ -36,7 +36,7 @@ http {
--
Instance
means
the
number
of
Nginx
deployment,
does
not
mean
the
worker
instances
metadata_buffer:set('serviceInstanceName',
'User_Service_Instance_Name')
require("client"):startBackendTimer("http://oap:12800")
require("
skywalking.
client"):startBackendTimer("http://oap:12800")
}
log_format
sw_trace
escape=json
"
$uri
$request_body
"
;
...
...
@@ -47,17 +47,17 @@ http {
location
/nginx/info
{
rewrite_by_lua_block
{
require
("tracer"):start("User_Service_Name",
{
nginx
=
"nginx_value"
}
)
require
("
skywalking.
tracer"):start("User_Service_Name",
{
nginx
=
"nginx_value"
}
)
}
proxy_pass
http://provider-end:9090/nginx/end/info
;
body_filter_by_lua_block
{
require
("tracer"):finish()
require
("
skywalking.
tracer"):finish()
}
log_by_lua_block
{
require
("tracer"):prepareForReport()
require
("
skywalking.
tracer"):prepareForReport()
}
}
}
...
...
test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/GOE2E.java
浏览文件 @
c95a9134
...
...
@@ -55,11 +55,14 @@ import org.junit.jupiter.api.BeforeAll;
import
org.testcontainers.containers.DockerComposeContainer
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsMatcher
.
verifyMetrics
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsMatcher
.
verifyPercentileMetrics
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_ENDPOINT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_ENDPOINT_MULTIPLE_LINEAR_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_INSTANCE_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_INSTANCE_RELATION_CLIENT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_INSTANCE_RELATION_SERVER_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_MULTIPLE_LINEAR_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_RELATION_CLIENT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_RELATION_SERVER_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
utils
.
Times
.
now
;
...
...
@@ -209,6 +212,9 @@ public class GOE2E extends SkyWalkingTestAdapter {
instanceRespTimeMatcher
.
verify
(
serviceMetrics
);
LOGGER
.
info
(
"{}: {}"
,
metricName
,
serviceMetrics
);
}
for
(
String
metricName
:
ALL_SERVICE_MULTIPLE_LINEAR_METRICS
)
{
verifyPercentileMetrics
(
graphql
,
metricName
,
service
.
getKey
(),
startTime
);
}
}
private
void
verifyInstancesMetrics
(
Instances
instances
)
throws
Exception
{
...
...
@@ -253,6 +259,9 @@ public class GOE2E extends SkyWalkingTestAdapter {
LOGGER
.
info
(
"{}: {}"
,
metricName
,
metrics
);
}
for
(
String
metricName
:
ALL_ENDPOINT_MULTIPLE_LINEAR_METRICS
)
{
verifyPercentileMetrics
(
graphql
,
metricName
,
endpoint
.
getKey
(),
startTime
);
}
}
}
...
...
test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/GatewayE2E.java
浏览文件 @
c95a9134
...
...
@@ -55,11 +55,14 @@ import org.junit.jupiter.api.BeforeAll;
import
org.testcontainers.containers.DockerComposeContainer
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsMatcher
.
verifyMetrics
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsMatcher
.
verifyPercentileMetrics
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_ENDPOINT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_ENDPOINT_MULTIPLE_LINEAR_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_INSTANCE_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_INSTANCE_RELATION_CLIENT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_INSTANCE_RELATION_SERVER_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_MULTIPLE_LINEAR_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_RELATION_CLIENT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_RELATION_SERVER_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
utils
.
Yamls
.
load
;
...
...
@@ -213,6 +216,9 @@ public class GatewayE2E extends SkyWalkingTestAdapter {
LOGGER
.
info
(
"verifying endpoint {}, metrics: {}"
,
endpoint
,
metricName
);
verifyMetrics
(
graphql
,
metricName
,
endpoint
.
getKey
(),
startTime
);
}
for
(
String
metricName
:
ALL_ENDPOINT_MULTIPLE_LINEAR_METRICS
)
{
verifyPercentileMetrics
(
graphql
,
metricName
,
endpoint
.
getKey
(),
startTime
);
}
}
}
...
...
@@ -221,6 +227,9 @@ public class GatewayE2E extends SkyWalkingTestAdapter {
LOGGER
.
info
(
"verifying service {}, metrics: {}"
,
service
,
metricName
);
verifyMetrics
(
graphql
,
metricName
,
service
.
getKey
(),
startTime
);
}
for
(
String
metricName
:
ALL_SERVICE_MULTIPLE_LINEAR_METRICS
)
{
verifyPercentileMetrics
(
graphql
,
metricName
,
service
.
getKey
(),
startTime
);
}
}
private
void
verifyServiceInstanceRelationMetrics
(
final
List
<
Call
>
calls
)
throws
Exception
{
...
...
test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/LuaE2E.java
浏览文件 @
c95a9134
...
...
@@ -59,11 +59,14 @@ import org.springframework.http.ResponseEntity;
import
org.testcontainers.containers.DockerComposeContainer
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsMatcher
.
verifyMetrics
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsMatcher
.
verifyPercentileMetrics
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_ENDPOINT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_ENDPOINT_MULTIPLE_LINEAR_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_INSTANCE_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_INSTANCE_RELATION_CLIENT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_INSTANCE_RELATION_SERVER_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_MULTIPLE_LINEAR_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_RELATION_CLIENT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_RELATION_SERVER_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
utils
.
Yamls
.
load
;
...
...
@@ -239,6 +242,9 @@ public class LuaE2E extends SkyWalkingTestAdapter {
LOGGER
.
info
(
"{}: {}"
,
metricName
,
metrics
);
}
for
(
String
metricName
:
ALL_ENDPOINT_MULTIPLE_LINEAR_METRICS
)
{
verifyPercentileMetrics
(
graphql
,
metricName
,
endpoint
.
getKey
(),
startTime
);
}
}
}
...
...
@@ -256,6 +262,9 @@ public class LuaE2E extends SkyWalkingTestAdapter {
instanceRespTimeMatcher
.
verify
(
serviceMetrics
);
LOGGER
.
info
(
"{}: {}"
,
metricName
,
serviceMetrics
);
}
for
(
String
metricName
:
ALL_SERVICE_MULTIPLE_LINEAR_METRICS
)
{
verifyPercentileMetrics
(
graphql
,
metricName
,
service
.
getKey
(),
startTime
);
}
}
private
void
verifyServiceInstanceRelationMetrics
(
final
List
<
Call
>
calls
)
throws
Exception
{
...
...
test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/PHPE2E.java
浏览文件 @
c95a9134
...
...
@@ -56,11 +56,14 @@ import org.junit.jupiter.api.BeforeAll;
import
org.testcontainers.containers.DockerComposeContainer
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsMatcher
.
verifyMetrics
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsMatcher
.
verifyPercentileMetrics
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_ENDPOINT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_ENDPOINT_MULTIPLE_LINEAR_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_INSTANCE_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_INSTANCE_RELATION_CLIENT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_INSTANCE_RELATION_SERVER_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_MULTIPLE_LINEAR_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_RELATION_CLIENT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_RELATION_SERVER_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
utils
.
Yamls
.
load
;
...
...
@@ -231,6 +234,9 @@ public class PHPE2E extends SkyWalkingTestAdapter {
LOGGER
.
info
(
"{}: {}"
,
metricName
,
metrics
);
}
for
(
String
metricName
:
ALL_ENDPOINT_MULTIPLE_LINEAR_METRICS
)
{
verifyPercentileMetrics
(
graphql
,
metricName
,
endpoint
.
getKey
(),
startTime
);
}
}
}
...
...
@@ -248,6 +254,9 @@ public class PHPE2E extends SkyWalkingTestAdapter {
instanceRespTimeMatcher
.
verify
(
serviceMetrics
);
LOGGER
.
info
(
"{}: {}"
,
metricName
,
serviceMetrics
);
}
for
(
String
metricName
:
ALL_SERVICE_MULTIPLE_LINEAR_METRICS
)
{
verifyPercentileMetrics
(
graphql
,
metricName
,
service
.
getKey
(),
startTime
);
}
}
private
void
verifyServiceInstanceRelationMetrics
(
final
List
<
Call
>
calls
)
throws
Exception
{
...
...
test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/PythonE2E.java
浏览文件 @
c95a9134
...
...
@@ -58,11 +58,14 @@ import java.util.List;
import
java.util.stream.Collectors
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsMatcher
.
verifyMetrics
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsMatcher
.
verifyPercentileMetrics
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_ENDPOINT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_ENDPOINT_MULTIPLE_LINEAR_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_INSTANCE_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_INSTANCE_RELATION_CLIENT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_INSTANCE_RELATION_SERVER_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_MULTIPLE_LINEAR_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_RELATION_CLIENT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_RELATION_SERVER_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
utils
.
Times
.
now
;
...
...
@@ -224,6 +227,9 @@ public class PythonE2E extends SkyWalkingTestAdapter {
LOGGER
.
info
(
"{}: {}"
,
metricName
,
metrics
);
}
for
(
String
metricName
:
ALL_ENDPOINT_MULTIPLE_LINEAR_METRICS
)
{
verifyPercentileMetrics
(
graphql
,
metricName
,
endpoint
.
getKey
(),
startTime
);
}
}
}
...
...
@@ -241,6 +247,10 @@ public class PythonE2E extends SkyWalkingTestAdapter {
instanceRespTimeMatcher
.
verify
(
serviceMetrics
);
LOGGER
.
info
(
"{}: {}"
,
metricName
,
serviceMetrics
);
}
for
(
String
metricName
:
ALL_SERVICE_MULTIPLE_LINEAR_METRICS
)
{
verifyPercentileMetrics
(
graphql
,
metricName
,
service
.
getKey
(),
startTime
);
}
}
private
void
verifyServiceInstanceRelationMetrics
(
final
List
<
Call
>
calls
)
throws
Exception
{
...
...
test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/kafka/KafkaE2E.java
浏览文件 @
c95a9134
...
...
@@ -58,12 +58,15 @@ import org.junit.jupiter.api.BeforeAll;
import
org.testcontainers.containers.DockerComposeContainer
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsMatcher
.
verifyMetrics
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsMatcher
.
verifyPercentileMetrics
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_ENDPOINT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_ENDPOINT_MULTIPLE_LINEAR_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_INSTANCE_JVM_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_INSTANCE_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_INSTANCE_RELATION_CLIENT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_INSTANCE_RELATION_SERVER_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_MULTIPLE_LINEAR_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_RELATION_CLIENT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_RELATION_SERVER_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SO11Y_LABELED_METRICS
;
...
...
@@ -300,6 +303,9 @@ public class KafkaE2E extends SkyWalkingTestAdapter {
LOGGER
.
info
(
"{}: {}"
,
metricName
,
metrics
);
}
for
(
String
metricName
:
ALL_ENDPOINT_MULTIPLE_LINEAR_METRICS
)
{
verifyPercentileMetrics
(
graphql
,
metricName
,
endpoint
.
getKey
(),
startTime
);
}
}
}
...
...
@@ -317,6 +323,10 @@ public class KafkaE2E extends SkyWalkingTestAdapter {
instanceRespTimeMatcher
.
verify
(
serviceMetrics
);
LOGGER
.
info
(
"{}: {}"
,
metricName
,
serviceMetrics
);
}
for
(
String
metricName
:
ALL_SERVICE_MULTIPLE_LINEAR_METRICS
)
{
verifyPercentileMetrics
(
graphql
,
metricName
,
service
.
getKey
(),
startTime
);
}
}
private
void
verifyServiceInstanceRelationMetrics
(
final
List
<
Call
>
calls
)
throws
Exception
{
...
...
test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/simple/SimpleE2E.java
浏览文件 @
c95a9134
...
...
@@ -18,9 +18,6 @@
package
org.apache.skywalking.e2e.simple
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.skywalking.e2e.annotation.ContainerHostAndPort
;
import
org.apache.skywalking.e2e.annotation.DockerCompose
;
...
...
@@ -59,17 +56,23 @@ import org.junit.jupiter.api.AfterAll;
import
org.junit.jupiter.api.BeforeAll
;
import
org.testcontainers.containers.DockerComposeContainer
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsMatcher
.
verifyMetrics
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsMatcher
.
verifyPercentileMetrics
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_ENDPOINT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_
INSTANCE
_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_
ENDPOINT_MULTIPLE_LINEAR
_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_INSTANCE_JVM_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_INSTANCE_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_INSTANCE_RELATION_CLIENT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_INSTANCE_RELATION_SERVER_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_MULTIPLE_LINEAR_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_RELATION_CLIENT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_RELATION_SERVER_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SO11Y_LINER_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SO11Y_LABELED_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SO11Y_LINER_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
utils
.
Times
.
now
;
import
static
org
.
apache
.
skywalking
.
e2e
.
utils
.
Yamls
.
load
;
...
...
@@ -133,7 +136,7 @@ public class SimpleE2E extends SkyWalkingTestAdapter {
public
void
tearDown
()
{
trafficController
.
stop
();
}
@RetryableTest
void
services
()
throws
Exception
{
List
<
Service
>
services
=
graphql
.
services
(
new
ServicesQuery
().
start
(
startTime
).
end
(
now
()));
...
...
@@ -195,7 +198,7 @@ public class SimpleE2E extends SkyWalkingTestAdapter {
verifyServiceInstanceRelationMetrics
(
topology
.
getCalls
());
}
@RetryableTest
void
so11y
()
throws
Exception
{
List
<
Service
>
services
=
graphql
.
services
(
new
ServicesQuery
().
start
(
startTime
).
end
(
now
()));
...
...
@@ -218,7 +221,7 @@ public class SimpleE2E extends SkyWalkingTestAdapter {
new
ReadMetricsQuery
().
stepByMinute
().
metricsName
(
metricsName
)
.
serviceName
(
service
.
getLabel
()).
instanceName
(
instance
.
getLabel
())
);
LOGGER
.
info
(
"{}: {}"
,
metricsName
,
instanceMetrics
);
final
AtLeastOneOfMetricsMatcher
instanceRespTimeMatcher
=
new
AtLeastOneOfMetricsMatcher
();
final
MetricsValueMatcher
greaterThanZero
=
new
MetricsValueMatcher
();
...
...
@@ -232,7 +235,7 @@ public class SimpleE2E extends SkyWalkingTestAdapter {
new
ReadMetricsQuery
().
stepByMinute
().
metricsName
(
metricsName
)
.
serviceName
(
service
.
getLabel
()).
instanceName
(
instance
.
getLabel
())
);
LOGGER
.
info
(
"{}: {}"
,
metricsName
,
instanceMetrics
);
Metrics
allValues
=
new
Metrics
();
for
(
ReadMetrics
readMetrics
:
instanceMetrics
)
{
...
...
@@ -295,7 +298,7 @@ public class SimpleE2E extends SkyWalkingTestAdapter {
for
(
String
metricsName
:
ALL_INSTANCE_JVM_METRICS
)
{
LOGGER
.
info
(
"verifying service instance response time: {}"
,
instance
);
final
Metrics
instanceJVMMetrics
=
graphql
.
metrics
(
new
MetricsQuery
().
stepByMinute
().
metricsName
(
metricsName
).
id
(
instance
.
getKey
())
new
MetricsQuery
().
stepByMinute
().
metricsName
(
metricsName
).
id
(
instance
.
getKey
())
);
LOGGER
.
info
(
"instance jvm metrics: {}"
,
instanceJVMMetrics
);
...
...
@@ -332,6 +335,9 @@ public class SimpleE2E extends SkyWalkingTestAdapter {
LOGGER
.
info
(
"{}: {}"
,
metricName
,
metrics
);
}
for
(
String
metricName
:
ALL_ENDPOINT_MULTIPLE_LINEAR_METRICS
)
{
verifyPercentileMetrics
(
graphql
,
metricName
,
endpoint
.
getKey
(),
startTime
);
}
}
}
...
...
@@ -339,7 +345,7 @@ public class SimpleE2E extends SkyWalkingTestAdapter {
for
(
String
metricName
:
ALL_SERVICE_METRICS
)
{
LOGGER
.
info
(
"verifying service {}, metrics: {}"
,
service
,
metricName
);
final
Metrics
serviceMetrics
=
graphql
.
metrics
(
new
MetricsQuery
().
stepByMinute
().
metricsName
(
metricName
).
id
(
service
.
getKey
())
new
MetricsQuery
().
stepByMinute
().
metricsName
(
metricName
).
id
(
service
.
getKey
())
);
LOGGER
.
info
(
"serviceMetrics: {}"
,
serviceMetrics
);
final
AtLeastOneOfMetricsMatcher
instanceRespTimeMatcher
=
new
AtLeastOneOfMetricsMatcher
();
...
...
@@ -349,6 +355,10 @@ public class SimpleE2E extends SkyWalkingTestAdapter {
instanceRespTimeMatcher
.
verify
(
serviceMetrics
);
LOGGER
.
info
(
"{}: {}"
,
metricName
,
serviceMetrics
);
}
for
(
String
metricName
:
ALL_SERVICE_MULTIPLE_LINEAR_METRICS
)
{
verifyPercentileMetrics
(
graphql
,
metricName
,
service
.
getKey
(),
startTime
);
}
}
private
void
verifyServiceInstanceRelationMetrics
(
final
List
<
Call
>
calls
)
throws
Exception
{
...
...
test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/storage/StorageE2E.java
浏览文件 @
c95a9134
...
...
@@ -70,11 +70,14 @@ import org.junit.jupiter.api.Test;
import
org.testcontainers.containers.DockerComposeContainer
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsMatcher
.
verifyMetrics
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsMatcher
.
verifyPercentileMetrics
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_ENDPOINT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_ENDPOINT_MULTIPLE_LINEAR_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_INSTANCE_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_INSTANCE_RELATION_CLIENT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_INSTANCE_RELATION_SERVER_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_MULTIPLE_LINEAR_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_RELATION_CLIENT_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SERVICE_RELATION_SERVER_METRICS
;
import
static
org
.
apache
.
skywalking
.
e2e
.
metrics
.
MetricsQuery
.
ALL_SO11Y_LINER_METRICS
;
...
...
@@ -342,6 +345,10 @@ public class StorageE2E extends SkyWalkingTestAdapter {
LOGGER
.
info
(
"{}: {}"
,
metricName
,
metrics
);
}
for
(
String
metricName
:
ALL_ENDPOINT_MULTIPLE_LINEAR_METRICS
)
{
verifyPercentileMetrics
(
graphql
,
metricName
,
endpoint
.
getKey
(),
startTime
);
}
}
}
...
...
@@ -359,6 +366,10 @@ public class StorageE2E extends SkyWalkingTestAdapter {
instanceRespTimeMatcher
.
verify
(
serviceMetrics
);
LOGGER
.
info
(
"{}: {}"
,
metricName
,
serviceMetrics
);
}
for
(
String
metricName
:
ALL_SERVICE_MULTIPLE_LINEAR_METRICS
)
{
verifyPercentileMetrics
(
graphql
,
metricName
,
service
.
getKey
(),
startTime
);
}
}
private
void
verifyServiceInstanceRelationMetrics
(
final
List
<
Call
>
calls
)
throws
Exception
{
...
...
test/e2e/e2e-test/src/test/resources/expected/go/topo.yml
浏览文件 @
c95a9134
...
...
@@ -24,7 +24,7 @@ nodes:
isReal
:
true
-
id
:
Z28yc2t5.1
name
:
go2sky
type
:
http
type
:
GoHttpServer
isReal
:
true
-
id
:
ZTJlLXNlcnZpY2UtamF2YS1wcm92aWRlcg==.1
name
:
e2e-service-java-provider
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录