未验证 提交 c95a9134 编写于 作者: H Humbertzhang 提交者: GitHub

Add percentile tests in e2e test. (#5737)

上级 2aeefcec
......@@ -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;
}
}
......@@ -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;
}
}
......@@ -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("");
}
......
......@@ -15,7 +15,7 @@
FROM golang:1.12 AS builder
ARG COMMIT_HASH=140002c944931ebc0e8e1ea6f7dca128108cf4e7
ARG COMMIT_HASH=38c3b84741dd6c0609965e9df0fcc633915d3ea5
ARG GO2SKY_CODE=${COMMIT_HASH}.tar.gz
ARG GO2SKY_CODE_URL=https://github.com/SkyAPM/go2sky/archive/${GO2SKY_CODE}
......
......@@ -15,7 +15,7 @@
FROM openresty/openresty
ENV COMMIT_HASH=b4700215abf5797279e7613ab96d8141a89d0b48
ENV COMMIT_HASH=cda47ae0a507ab86a378a298325c3c94d9a773c2
WORKDIR /usr/share/skywalking-nginx-lua
......
......@@ -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()
}
}
}
......
......@@ -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);
}
}
}
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册