use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class GCResourceGroup method getGcResourceSeries.
private GCResource getGcResourceSeries(String entry) {
GCResource resource;
List<GCResource> series = new ArrayList<>();
for (String s : entry.split(SERIES_SEPARATOR)) {
series.add(new GcResourceFile(s));
}
resource = new GcResourceSeries(series);
return resource;
}
use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class TestDataReaderJRockit1_5_0 method testMalformedType.
/**
* Test parsing of a malformed type. The test just expects an INFO to be logged - nothing else.
*/
@Test
public void testMalformedType() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.INFO);
GCResource gcResource = new GcResourceFile("byteArray");
gcResource.getLogger().addHandler(handler);
ByteArrayInputStream in = new ByteArrayInputStream(("[memory ][Thu Feb 21 15:06:38 2013][11844] 6.290-6.424: GC-malformed 3128161K->296406K (3145728K), sum of pauses 59.084 ms").getBytes());
DataReader reader = new DataReaderJRockit1_5_0(gcResource, in);
reader.read();
// 3 INFO events:
// Reading JRockit ... format
// Failed to determine type ...
// Reading done.
assertEquals("number of infos", 3, handler.getCount());
List<LogRecord> logRecords = handler.getLogRecords();
assertEquals("should start with 'Failed to determine type'", 0, logRecords.get(1).getMessage().indexOf("Failed to determine type"));
}
use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class TestDataReaderJRockit1_6_0 method testGcPrioPauseSingleParConVerbose.
@Test
public void testGcPrioPauseSingleParConVerbose() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("SampleJRockit1_6_verbose_gc_mode_singleparcon.txt");
gcResource.getLogger().addHandler(handler);
DataReader reader = getDataReader(gcResource);
assertTrue("should be DataReaderJRockit1_6_0 (but was " + reader.toString() + ")", reader instanceof DataReaderJRockit1_6_0);
GCModel model = reader.read();
assertEquals("count", 52, model.size());
GCEvent event = (GCEvent) model.get(0);
assertEquals("timestamp", 26.242, event.getTimestamp(), 0.000001);
assertEquals("name", Type.JROCKIT_16_OLD_GC.getName(), event.getExtendedType().getName());
assertEquals("before", 270909, event.getPreUsed());
assertEquals("after", 210916, event.getPostUsed());
assertEquals("total", 524288, event.getTotal());
assertEquals("pause", 0.032087, event.getPause(), 0.0000001);
assertEquals("number of warnings", 5, handler.getCount());
}
use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class TestDataReaderJRockit1_6_0 method testMalformedType.
@Test
public void testMalformedType() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.INFO);
GCResource gcResource = new GcResourceFile("byteArray");
gcResource.getLogger().addHandler(handler);
ByteArrayInputStream in = new ByteArrayInputStream(("[INFO ][memory ] [YC#1] 9.743-9.793: YC-malformed 294974KB->122557KB (524288KB), 0.050 s, sum of pauses 49.692 ms, longest pause 49.692 ms.").getBytes());
DataReader reader = new DataReaderJRockit1_6_0(gcResource, in);
reader.read();
// 3 INFO events:
// Reading JRockit ... format
// Failed to determine type ...
// Reading done.
assertEquals("number of infos", 3, handler.getCount());
List<LogRecord> logRecords = handler.getLogRecords();
assertEquals("should start with 'Failed to determine type'", 0, logRecords.get(1).getMessage().indexOf("Failed to determine type"));
}
use of com.tagtraum.perf.gcviewer.model.GCResource in project GCViewer by chewiebug.
the class TestDataReaderJRockit1_6_0 method testGcPrioPauseSingleParCon.
@Test
public void testGcPrioPauseSingleParCon() throws Exception {
TestLogHandler handler = new TestLogHandler();
handler.setLevel(Level.WARNING);
GCResource gcResource = new GcResourceFile("SampleJRockit1_6_gc_mode_singleparcon.txt");
gcResource.getLogger().addHandler(handler);
DataReader reader = getDataReader(gcResource);
GCModel model = reader.read();
assertEquals("count", 42, model.size());
GCEvent event = (GCEvent) model.get(0);
assertEquals("timestamp", 24.930, event.getTimestamp(), 0.000001);
assertEquals("name", Type.JROCKIT_16_OLD_GC.getName(), event.getExtendedType().getName());
assertEquals("before", 464309, event.getPreUsed());
assertEquals("after", 282831, event.getPostUsed());
assertEquals("total", 524288, event.getTotal());
assertEquals("pause", 0.020957, event.getPause(), 0.0000001);
assertEquals("number of warnings", 5, handler.getCount());
}
Aggregations