Search in sources :

Example 1 with IgnoreChildSocketCalls

use of com.newrelic.agent.tracers.IgnoreChildSocketCalls in project newrelic-java-agent by newrelic.

the class TransactionProfileSessionImpl method noticeTracerStart.

@Override
public void noticeTracerStart(int signatureId, int tracerFlags, Tracer tracer) {
    if (!threadService.isCurrentThreadAnAgentThread()) {
        if (tracer == null) {
            discoveryProfile.noticeStartTracer(signatureId);
            Thread currentThread = Thread.currentThread();
            profile.addStackTrace(new BasicThreadInfo(currentThread), currentThread.getStackTrace(), true, ThreadType.BasicThreadType.OTHER);
        } else if (tracer.isLeaf() || tracer instanceof IgnoreChildSocketCalls) {
            if (stackTraceLimits.get(tracer.getMetricName()).getAndIncrement() < STACK_CAPTURE_LIMIT_PER_METRIC_PER_PERIOD) {
                tracer.setAgentAttribute(DefaultTracer.BACKTRACE_PARAMETER_NAME, Thread.currentThread().getStackTrace());
            }
        }
    }
}
Also used : BasicThreadInfo(com.newrelic.agent.threads.BasicThreadInfo) IgnoreChildSocketCalls(com.newrelic.agent.tracers.IgnoreChildSocketCalls)

Aggregations

BasicThreadInfo (com.newrelic.agent.threads.BasicThreadInfo)1 IgnoreChildSocketCalls (com.newrelic.agent.tracers.IgnoreChildSocketCalls)1