public class OldLttngJulHandlerTracingDisabledBenchmark extends JulHandlerBenchmarkBase {
private ILttngSession session;
+ private LTTngAgent agent;
/**
* Test setup
*/
@Before
public void testSetup() {
- LTTngAgent.getLTTngAgent();
+ agent = LTTngAgent.getLTTngAgent();
session = ILttngSession.createSession(null, Domain.JUL);
assertTrue(session.enableEvents("non-event"));
assertTrue(session.stop());
session.close();
- LTTngAgent.dispose();
+ agent.dispose();
}
}
public class OldLttngJulHandlerTracingEnabledBenchmark extends JulHandlerBenchmarkBase {
private ILttngSession session;
+ private LTTngAgent agent;
private LttngLogHandler agentHandler;
*/
@Before
public void testSetup() {
- LTTngAgent agentInstance = LTTngAgent.getLTTngAgent();
+ agent = LTTngAgent.getLTTngAgent();
/*
* The "old API" works by attaching a handler managed by the agent to
try {
Field julHandlerField = LTTngAgent.class.getDeclaredField("julHandler");
julHandlerField.setAccessible(true);
- agentHandler = (LttngLogHandler) julHandlerField.get(agentInstance);
+ agentHandler = (LttngLogHandler) julHandlerField.get(agent);
logger.addHandler(agentHandler);
session.close();
logger.removeHandler(agentHandler);
- LTTngAgent.dispose();
+ agent.dispose();
}
}
private static final String EVENT_NAME_B = "EventB";
private ILttngSession session;
+ private LTTngAgent agent;
private Logger loggerA;
private Logger loggerB;
@Before
public void setup() {
loggerA = Logger.getLogger(EVENT_NAME_A);
- LTTngAgent.getLTTngAgent();
+ agent = LTTngAgent.getLTTngAgent();
loggerB = Logger.getLogger(EVENT_NAME_B);
loggerA.setLevel(Level.ALL);
public void tearDown() {
session.close();
- LTTngAgent.dispose();
+ agent.dispose();
loggerA = null;
loggerB = null;
private static final String EVENT_NAME_B = "EventB";
private ILttngSession session;
+ private LTTngAgent agent;
private Logger loggerA;
private Logger loggerB;
@Before
public void setup() {
loggerA = Logger.getLogger(EVENT_NAME_A);
- LTTngAgent.getLTTngAgent();
+ agent = LTTngAgent.getLTTngAgent();
loggerB = Logger.getLogger(EVENT_NAME_B);
loggerA.setLevel(Level.ALL);
public void tearDown() {
session.close();
- LTTngAgent.dispose();
+ agent.dispose();
loggerA = null;
loggerB = null;