use of co.elastic.apm.impl.payload.RuntimeInfo in project apm-agent-java by elastic.
the class AbstractReporterBenchmark method setUp.
@Setup
public void setUp() throws Exception {
tracer = ElasticApmTracer.builder().reporter(reporter).stacktraceFactory(StacktraceFactory.Noop.INSTANCE).build();
// in contrast to production configuration, do not drop transactions if the ring buffer is full
// instead blocking wait until a slot becomes available
// this is important because otherwise we would not measure the speed at which events can be handled
// but rather how fast events get discarded
payloadSender = getPayloadSender();
Service service = new Service().withName("java-test").withVersion("1.0").withEnvironment("test").withAgent(new Agent("elastic-apm-java", "1.0.0")).withRuntime(new RuntimeInfo("Java", "9.0.4")).withFramework(new Framework("Servlet API", "3.1")).withLanguage(new Language("Java", "9.0.4"));
ProcessInfo process = new ProcessInfo("/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/bin/java").withPid(2103).withPpid(403L).withArgv(Collections.singletonList("-javaagent:/path/to/elastic-apm-java.jar"));
SystemInfo system = new SystemInfo("x86_64", "Felixs-MBP", "Mac OS X");
ReporterConfiguration reporterConfiguration = new ReporterConfiguration();
reporter = new ApmServerReporter(tracer.getConfigurationRegistry(), service, process, system, payloadSender, false, reporterConfiguration);
payload = new TransactionPayload(process, service, system);
for (int i = 0; i < reporterConfiguration.getMaxQueueSize(); i++) {
Transaction t = new Transaction();
t.start(tracer, 0, ConstantSampler.of(true));
fillTransaction(t);
payload.getTransactions().add(t);
}
}
Aggregations