use of co.elastic.apm.impl.transaction.Transaction in project apm-agent-java by elastic.
the class ObjectPoolBenchmark method testMixedObjectPool.
// @Benchmark
@Threads(8)
public Transaction testMixedObjectPool() {
Transaction transaction = mixedObjectPool.createInstance();
mixedObjectPool.recycle(transaction);
return transaction;
}
use of co.elastic.apm.impl.transaction.Transaction in project apm-agent-java by elastic.
the class ObjectPoolBenchmark method testThreadLocalObjectPool.
@Benchmark
@Threads(8)
public Transaction testThreadLocalObjectPool() {
Transaction transaction = threadLocalObjectPool.createInstance();
threadLocalObjectPool.recycle(transaction);
return transaction;
}
use of co.elastic.apm.impl.transaction.Transaction in project apm-agent-java by elastic.
the class ApmFilter method captureTransaction.
void captureTransaction(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
if (request instanceof HttpServletRequest && response instanceof HttpServletResponse) {
HttpServletRequest httpRequest = (HttpServletRequest) request;
final Transaction transaction = tracer.startTransaction();
try {
filterChain.doFilter(request, response);
fillTransaction(transaction, httpRequest, (HttpServletResponse) response);
} catch (IOException | RuntimeException | ServletException e) {
tracer.captureException(e);
throw e;
} finally {
transaction.end();
}
}
}
use of co.elastic.apm.impl.transaction.Transaction in project apm-agent-java by elastic.
the class BodyProcessorTest method processBeforeReport_Transaction_EventTypeOff.
@Test
void processBeforeReport_Transaction_EventTypeOff() {
when(config.getCaptureBody()).thenReturn(WebConfiguration.EventType.OFF);
final Transaction transaction = processTransaction();
assertThat(transaction.getContext().getRequest().getBody()).isEqualTo("[REDACTED]");
}
use of co.elastic.apm.impl.transaction.Transaction in project apm-agent-java by elastic.
the class BodyProcessorTest method processBeforeReport_Transaction_EventTypeTransaction.
@Test
void processBeforeReport_Transaction_EventTypeTransaction() {
when(config.getCaptureBody()).thenReturn(WebConfiguration.EventType.TRANSACTIONS);
final Transaction transaction = processTransaction();
assertThat(transaction.getContext().getRequest().getBody()).isEqualTo("foo");
}
Aggregations