@Test public void testGenCon() throws Exception { InputStream in = getInputStream("SampleJRockit1_5_12_gencon.txt"); DataReader reader = new DataReaderJRockit1_5_0(in); GCModel model = reader.read(); assertEquals("count", 8, model.size()); GCEvent event = (GCEvent) model.get(0); assertEquals("timestamp", 6.038, event.getTimestamp(), 0.000001); assertEquals("name", Type.JROCKIT_GC.getName(), event.getExtendedType().getName()); assertEquals("before", 3089328, event.getPreUsed()); assertEquals("after", 352551, event.getPostUsed()); assertEquals("total", 3145728, event.getTotal()); assertEquals("pause", 0.1186, event.getPause(), 0.0000001); }
@Test public void testGcPrioThroughput() throws Exception { InputStream in = getInputStream("SampleJRockit1_5_12_gcpriothroughput.txt"); DataReader reader = new DataReaderJRockit1_5_0(in); GCModel model = reader.read(); assertEquals("count", 8, model.size()); GCEvent event = (GCEvent) model.get(0); assertEquals("timestamp", 4.817, event.getTimestamp(), 0.000001); assertEquals("name", Type.JROCKIT_GC.getName(), event.getExtendedType().getName()); assertEquals("before", 1641728, event.getPreUsed()); assertEquals("after", 148365, event.getPostUsed()); assertEquals("total", 3145728, event.getTotal()); assertEquals("pause", 0.039959, event.getPause(), 0.0000001); }
@Test public void testSimpleOpts() throws Exception { InputStream in = getInputStream("SampleJRockit1_5_12-gcreport-simpleopts-singlecon.txt"); DataReader reader = new DataReaderJRockit1_5_0(in); GCModel model = reader.read(); assertEquals("count", 5, model.size()); GCEvent event = (GCEvent) model.get(0); assertEquals("timestamp", 6.771, event.getTimestamp(), 0.000001); assertEquals("name", Type.JROCKIT_GC.getName(), event.getExtendedType().getName()); assertEquals("before", 3145728, event.getPreUsed()); assertEquals("after", 296406, event.getPostUsed()); assertEquals("total", 3145728, event.getTotal()); assertEquals("pause", 0.066, event.getPause(), 0.0000001); }
@Test public void testGcPrioPausetime() throws Exception { TestLogHandler handler = new TestLogHandler(); handler.setLevel(Level.WARNING); IMP_LOGGER.addHandler(handler); DATA_READER_FACTORY_LOGGER.addHandler(handler); InputStream in = getInputStream("SampleJRockit1_5_12_gcpriopausetime.txt"); DataReader reader = new DataReaderJRockit1_5_0(in); GCModel model = reader.read(); assertEquals("count", 10, model.size()); GCEvent event = (GCEvent) model.get(0); assertEquals("timestamp", 6.290, event.getTimestamp(), 0.000001); assertEquals("name", Type.JROCKIT_GC.getName(), event.getExtendedType().getName()); assertEquals("before", 3128161, event.getPreUsed()); assertEquals("after", 296406, event.getPostUsed()); assertEquals("total", 3145728, event.getTotal()); assertEquals("pause", 0.059084, event.getPause(), 0.0000001); assertEquals("number of warnings", 6, handler.getCount()); }