#1183 - ENH: Add support for transaction profiling

This commit is contained in:
rob bygrave
2017-10-25 01:07:00 +13:00
parent 093f82a87f
commit 7ebef51859
46 changed files with 1063 additions and 68 deletions
@@ -0,0 +1,34 @@
package io.ebeaninternal.server.transaction;
import io.ebean.config.ProfilingConfig;
import org.junit.Test;
import static org.junit.Assert.*;
public class DefaultProfileHandlerTest {
@Test
public void createProfileStream() throws Exception {
DefaultProfileHandler handler = new DefaultProfileHandler(new ProfilingConfig());
assertNotNull(handler.createProfileStream(12));
assertNull(handler.createProfileStream(0));
}
@Test
public void createProfileStream_when_specificIncludeIds() throws Exception {
ProfilingConfig config = new ProfilingConfig();
config.setIncludeProfileIds(new int[]{100,101});
DefaultProfileHandler handler = new DefaultProfileHandler(config);
assertNotNull(handler.createProfileStream(100));
assertNotNull(handler.createProfileStream(101));
assertNull(handler.createProfileStream(0));
assertNull(handler.createProfileStream(12));
}
}