Remove deprecated module (#4976)
This commit is contained in:
parent
a45aaf34fb
commit
606f39c9c7
|
@ -1,24 +0,0 @@
|
||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
id("otel.java-conventions")
|
|
||||||
}
|
|
||||||
|
|
||||||
description = "e2e benchmark"
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation("org.junit.jupiter:junit-jupiter-api:5.3.1")
|
|
||||||
implementation("org.slf4j:slf4j-simple:1.6.1")
|
|
||||||
implementation("org.testcontainers:testcontainers:1.16.2")
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks {
|
|
||||||
test {
|
|
||||||
dependsOn(":javaagent:shadowJar")
|
|
||||||
maxParallelForks = 2
|
|
||||||
|
|
||||||
doFirst {
|
|
||||||
jvmArgs("-Dio.opentelemetry.smoketest.agent.shadowJar.path=${project(":javaagent").tasks.getByName<ShadowJar>("shadowJar").archivePath}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,128 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright The OpenTelemetry Authors
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
package io.opentelemetry.e2ebenchmark;
|
|
||||||
|
|
||||||
import java.util.AbstractMap;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import java.util.stream.Stream;
|
|
||||||
import org.junit.jupiter.api.AfterEach;
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.testcontainers.containers.GenericContainer;
|
|
||||||
import org.testcontainers.containers.Network;
|
|
||||||
import org.testcontainers.containers.output.Slf4jLogConsumer;
|
|
||||||
import org.testcontainers.containers.wait.strategy.Wait;
|
|
||||||
import org.testcontainers.lifecycle.Startables;
|
|
||||||
import org.testcontainers.utility.DockerImageName;
|
|
||||||
import org.testcontainers.utility.MountableFile;
|
|
||||||
|
|
||||||
public class AgentBenchmark {
|
|
||||||
private static final String APP_NAME =
|
|
||||||
System.getenv()
|
|
||||||
.getOrDefault(
|
|
||||||
"APP_IMAGE",
|
|
||||||
"ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-spring-boot:jdk8-20211213.1570880324");
|
|
||||||
|
|
||||||
private List<GenericContainer<?>> containers;
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(AgentBenchmark.class);
|
|
||||||
|
|
||||||
// docker images
|
|
||||||
private static final DockerImageName APP_IMAGE = DockerImageName.parse(APP_NAME);
|
|
||||||
private static final DockerImageName OTLP_COLLECTOR_IMAGE =
|
|
||||||
DockerImageName.parse("otel/opentelemetry-collector-dev:latest");
|
|
||||||
private static final DockerImageName WRK_IMAGE = DockerImageName.parse("quay.io/dim/wrk:stable");
|
|
||||||
|
|
||||||
@BeforeEach
|
|
||||||
void setUp() {
|
|
||||||
containers = new ArrayList<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
@AfterEach
|
|
||||||
void tearDown() {
|
|
||||||
containers.forEach(GenericContainer::stop);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void run() throws InterruptedException {
|
|
||||||
runBenchmark();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void runBenchmark() throws InterruptedException {
|
|
||||||
String agentPath = System.getProperty("io.opentelemetry.smoketest.agent.shadowJar.path");
|
|
||||||
|
|
||||||
// otlp collector container
|
|
||||||
GenericContainer<?> collector =
|
|
||||||
new GenericContainer<>(OTLP_COLLECTOR_IMAGE)
|
|
||||||
.withNetwork(Network.SHARED)
|
|
||||||
.withNetworkAliases("collector")
|
|
||||||
.withLogConsumer(new Slf4jLogConsumer(logger))
|
|
||||||
.withExposedPorts(4317, 13133)
|
|
||||||
.waitingFor(Wait.forHttp("/").forPort(13133))
|
|
||||||
.withCopyFileToContainer(
|
|
||||||
MountableFile.forClasspathResource("collector-config.yml"),
|
|
||||||
"/etc/collector/collector-config.yml")
|
|
||||||
.withCommand("--config /etc/collector/collector-config.yml --log-level=DEBUG");
|
|
||||||
containers.add(collector);
|
|
||||||
|
|
||||||
// sample app container
|
|
||||||
GenericContainer<?> app =
|
|
||||||
new GenericContainer<>(APP_IMAGE)
|
|
||||||
.withNetwork(Network.SHARED)
|
|
||||||
.withLogConsumer(new Slf4jLogConsumer(logger))
|
|
||||||
.withNetworkAliases("app")
|
|
||||||
.withCopyFileToContainer(
|
|
||||||
MountableFile.forHostPath(agentPath), "/opentelemetry-javaagent.jar")
|
|
||||||
.withEnv("OTEL_EXPORTER_OTLP_ENDPOINT", "collector:4317")
|
|
||||||
.withEnv("JAVA_TOOL_OPTIONS", "-javaagent:/opentelemetry-javaagent.jar")
|
|
||||||
.withExposedPorts(8080);
|
|
||||||
containers.add(app);
|
|
||||||
|
|
||||||
// wrk benchmark container
|
|
||||||
GenericContainer<?> wrk =
|
|
||||||
new GenericContainer<>(WRK_IMAGE)
|
|
||||||
.withNetwork(Network.SHARED)
|
|
||||||
.withLogConsumer(new Slf4jLogConsumer(logger))
|
|
||||||
.withCreateContainerCmdModifier(it -> it.withEntrypoint("wrk"))
|
|
||||||
.withCommand("-t4 -c128 -d300s http://app:8080/ --latency");
|
|
||||||
containers.add(wrk);
|
|
||||||
|
|
||||||
wrk.dependsOn(app, collector);
|
|
||||||
Startables.deepStart(Stream.of(wrk)).join();
|
|
||||||
|
|
||||||
logger.info("Benchmark started");
|
|
||||||
printContainerMapping(collector);
|
|
||||||
printContainerMapping(app);
|
|
||||||
|
|
||||||
while (wrk.isRunning()) {
|
|
||||||
Thread.sleep(1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
Thread.sleep(5000);
|
|
||||||
logger.info("Benchmark complete, wrk output:");
|
|
||||||
logger.info(wrk.getLogs().replace("\n\n", "\n"));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void printContainerMapping(GenericContainer<?> container) {
|
|
||||||
logger.info(
|
|
||||||
"Container {} ports exposed at {}",
|
|
||||||
container.getDockerImageName(),
|
|
||||||
container.getExposedPorts().stream()
|
|
||||||
.map(
|
|
||||||
port ->
|
|
||||||
new AbstractMap.SimpleImmutableEntry<>(
|
|
||||||
port,
|
|
||||||
"http://"
|
|
||||||
+ container.getContainerIpAddress()
|
|
||||||
+ ":"
|
|
||||||
+ container.getMappedPort(port)))
|
|
||||||
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,33 +0,0 @@
|
||||||
receivers:
|
|
||||||
otlp:
|
|
||||||
protocols:
|
|
||||||
grpc:
|
|
||||||
endpoint: 0.0.0.0:4317
|
|
||||||
|
|
||||||
exporters:
|
|
||||||
logging:
|
|
||||||
loglevel: info
|
|
||||||
|
|
||||||
processors:
|
|
||||||
batch:
|
|
||||||
|
|
||||||
extensions:
|
|
||||||
health_check:
|
|
||||||
|
|
||||||
service:
|
|
||||||
extensions: health_check
|
|
||||||
pipelines:
|
|
||||||
traces:
|
|
||||||
processors:
|
|
||||||
- batch
|
|
||||||
receivers:
|
|
||||||
- otlp
|
|
||||||
exporters:
|
|
||||||
- logging
|
|
||||||
metrics:
|
|
||||||
processors:
|
|
||||||
- batch
|
|
||||||
receivers:
|
|
||||||
- otlp
|
|
||||||
exporters:
|
|
||||||
- logging
|
|
|
@ -396,6 +396,5 @@ include(":instrumentation:vertx:vertx-web-3.0:testing")
|
||||||
include(":instrumentation:wicket-8.0:javaagent")
|
include(":instrumentation:wicket-8.0:javaagent")
|
||||||
|
|
||||||
// benchmark
|
// benchmark
|
||||||
include(":benchmark-e2e")
|
|
||||||
include(":benchmark-overhead-jmh")
|
include(":benchmark-overhead-jmh")
|
||||||
include(":benchmark-jfr-analyzer")
|
include(":benchmark-jfr-analyzer")
|
||||||
|
|
Loading…
Reference in New Issue