Search in sources :

Example 81 with GCModel

use of com.tagtraum.perf.gcviewer.model.GCModel in project GCViewer by chewiebug.

the class TestDataReaderJRockit1_4_2 method testParseTsGCReportGencon.

@Test
public void testParseTsGCReportGencon() throws Exception {
    DataReader reader = getDataReader1_4("SampleJRockit1_4_2ts-gcreport-gencon.txt");
    GCModel model = reader.read();
    assertEquals("count", 63, model.size());
    GCEvent event = (GCEvent) model.get(0);
    assertEquals("timestamp", 13.594, event.getTimestamp(), 0.000001);
    assertEquals("name", Type.JROCKIT_NURSERY_GC.getName(), event.getExtendedType().getName());
    assertEquals("before", 13824, event.getPreUsed());
    assertEquals("after", 4553, event.getPostUsed());
    assertEquals("total", 32768, event.getTotal());
    assertEquals("pause", 0.028308, event.getPause(), 0.0000001);
}
Also used : GCEvent(com.tagtraum.perf.gcviewer.model.GCEvent) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 82 with GCModel

use of com.tagtraum.perf.gcviewer.model.GCModel in project GCViewer by chewiebug.

the class TestDataReaderJRockit1_4_2 method testParseGenCon.

@Test
public void testParseGenCon() throws Exception {
    // TODO refactor JRockit DataReader
    DataReader reader = getDataReader1_5("SampleJRockit1_4_2gencon.txt");
    GCModel model = reader.read();
    assertEquals("count", 123, model.size());
    GCEvent event = (GCEvent) model.get(0);
    assertEquals("timestamp", 77.737, event.getTimestamp(), 0.000001);
    assertEquals("name", Type.JROCKIT_NURSERY_GC.getName(), event.getExtendedType().getName());
    assertEquals("before", 630435, event.getPreUsed());
    assertEquals("after", 183741, event.getPostUsed());
    assertEquals("total", 1048576, event.getTotal());
    assertEquals("pause", 0.566158, event.getPause(), 0.0000001);
}
Also used : GCEvent(com.tagtraum.perf.gcviewer.model.GCEvent) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 83 with GCModel

use of com.tagtraum.perf.gcviewer.model.GCModel in project GCViewer by chewiebug.

the class TestDataReaderJRockit1_5_0 method testGenCon.

@Test
public void testGenCon() throws Exception {
    DataReader reader = getDataReader1_5(new GcResourceFile("SampleJRockit1_5_12_gencon.txt"));
    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);
}
Also used : GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GCEvent(com.tagtraum.perf.gcviewer.model.GCEvent) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 84 with GCModel

use of com.tagtraum.perf.gcviewer.model.GCModel in project GCViewer by chewiebug.

the class TestDataReaderSun1_6_0 method testPrintTenuringDistribution.

@Test
public void testPrintTenuringDistribution() throws Exception {
    ByteArrayInputStream in = new ByteArrayInputStream(("2011-02-14T13:15:24.164+0100: 31581.748: [GC 31581.748: [ParNew" + "\nDesired survivor size 5963776 bytes, new threshold 1 (max 4)" + "\n- age   1:    8317928 bytes,    8317928 total" + "\n: 92938K->8649K(104832K), 0.0527364 secs] 410416K->326127K(1036928K), 0.0533874 secs] [Times: user=0.46 sys=0.09, real=0.05 secs]").getBytes());
    DataReader reader = new DataReaderSun1_6_0(new GcResourceFile("byteArray"), in, GcLogType.SUN1_6);
    GCModel model = reader.read();
    assertEquals("GC count", 1, model.size());
    assertEquals("event pause", 0.0533874, model.getGCPause().getMax(), 0.0000001);
    assertEquals("promotion", 0, model.getPromotion().getMax());
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 85 with GCModel

use of com.tagtraum.perf.gcviewer.model.GCModel in project GCViewer by chewiebug.

the class TestDataReaderSun1_6_0 method testPrintCmsStatistics.

@Test
public void testPrintCmsStatistics() throws Exception {
    // will not be able to extract sense from this line, but must not loop
    ByteArrayInputStream in = new ByteArrayInputStream(("0.521: [GC[YG occupancy: 2234 K (14784 K)]0.522: [Rescan (parallel)  (Survivor:0chunks) Finished young gen rescan work in 1th thread: 0.000 sec").getBytes());
    DataReader reader = new DataReaderSun1_6_0(new GcResourceFile("byteArray"), in, GcLogType.SUN1_6);
    GCModel model = reader.read();
    assertEquals("GC count", 0, model.size());
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Aggregations

GCModel (com.tagtraum.perf.gcviewer.model.GCModel)167 Test (org.junit.Test)145 GcResourceFile (com.tagtraum.perf.gcviewer.model.GcResourceFile)133 ByteArrayInputStream (java.io.ByteArrayInputStream)89 GCEvent (com.tagtraum.perf.gcviewer.model.GCEvent)45 InputStream (java.io.InputStream)45 GCResource (com.tagtraum.perf.gcviewer.model.GCResource)40 AbstractGCEvent (com.tagtraum.perf.gcviewer.model.AbstractGCEvent)15 IOException (java.io.IOException)14 GcResourceSeries (com.tagtraum.perf.gcviewer.model.GcResourceSeries)3 SimpleDateFormat (java.text.SimpleDateFormat)3 ArrayList (java.util.ArrayList)3 DoubleData (com.tagtraum.perf.gcviewer.math.DoubleData)2 StringTokenizer (java.util.StringTokenizer)2 Logger (java.util.logging.Logger)2 DataReaderException (com.tagtraum.perf.gcviewer.imp.DataReaderException)1 DataReaderFacade (com.tagtraum.perf.gcviewer.imp.DataReaderFacade)1 ConcurrentGCEvent (com.tagtraum.perf.gcviewer.model.ConcurrentGCEvent)1 VmOperationEvent (com.tagtraum.perf.gcviewer.model.VmOperationEvent)1 ModelChartImpl (com.tagtraum.perf.gcviewer.view.ModelChartImpl)1