Search in sources :

Example 6 with GCResource

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

the class TestDataReaderSun1_8_0 method scavengeBeforeRemarkPrintHeapAtGC_YGOccupancy.

@Test
public void scavengeBeforeRemarkPrintHeapAtGC_YGOccupancy() throws Exception {
    TestLogHandler handler = new TestLogHandler();
    handler.setLevel(Level.WARNING);
    GCResource gcResource = new GcResourceFile("SampleSun1_8_0CMS_ScavengeBeforeRemark_HeapAtGc.txt");
    gcResource.getLogger().addHandler(handler);
    DataReader reader = getDataReader(gcResource);
    GCModel model = reader.read();
    assertThat("gc count", model.size(), is(2));
    assertThat("scavenge before remark event", model.get(0).getPause(), closeTo(0.0000778, 0.000000001));
    assertThat("remark event", model.get(1).getPause(), closeTo(0.0019970 - 0.0000778, 0.000000001));
    assertEquals("number of errors", 0, handler.getCount());
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 7 with GCResource

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

the class TestDataReaderSun1_8_0 method parallelPrintHeapAtGC.

@Test
public void parallelPrintHeapAtGC() throws Exception {
    TestLogHandler handler = new TestLogHandler();
    handler.setLevel(Level.WARNING);
    GCResource gcResource = new GcResourceFile("SampleSun1_8_0ParallelPrintHeapAtGC.txt");
    gcResource.getLogger().addHandler(handler);
    DataReader reader = getDataReader(gcResource);
    GCModel model = reader.read();
    assertThat("gc pause sum", model.getPause().getSum(), closeTo(0.0103603, 0.000000001));
    assertThat("number of errors", handler.getCount(), is(0));
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 8 with GCResource

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

the class TestDataReaderSun1_8_0 method parallelApple.

@Test
public void parallelApple() throws Exception {
    TestLogHandler handler = new TestLogHandler();
    handler.setLevel(Level.WARNING);
    GCResource gcResource = new GcResourceFile("SampleSun1_8_0Parallel_Apple.txt");
    gcResource.getLogger().addHandler(handler);
    DataReader reader = getDataReader(gcResource);
    GCModel model = reader.read();
    assertThat("gc count", model.size(), is(6));
    assertEquals("number of errors", 0, handler.getCount());
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 9 with GCResource

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

the class TestDataReaderSun1_8_0G1 method fullGcWithDetailedSizes.

/**
     * In java 8, suddenly the full gc events in G1 got detailed information about the generation
     * sizes again. Test, that they are parsed correctly.
     */
@Test
public void fullGcWithDetailedSizes() throws Exception {
    TestLogHandler handler = new TestLogHandler();
    handler.setLevel(Level.WARNING);
    GCResource gcResource = new GcResourceFile("byteArray");
    ByteArrayInputStream in = new ByteArrayInputStream(("2014-07-24T13:49:45.090+0400: 92457.841: [Full GC (Allocation Failure)  5811M->3097M(12G), 8.9862292 secs]" + "\n  [Eden: 4096.0K(532.0M)->0.0B(612.0M) Survivors: 80.0M->0.0B Heap: 5811.9M(12.0G)->3097.8M(12.0G)], [Metaspace: 95902K->95450K(1140736K)]" + "\n [Times: user=12.34 sys=0.22, real=8.99 secs]").getBytes());
    DataReader reader = new DataReaderSun1_6_0G1(gcResource, in, GcLogType.SUN1_8);
    GCModel model = reader.read();
    GCEvent event = (GCEvent) model.get(0);
    assertThat("footprint", event.getTotal(), is(12 * 1024 * 1024));
    assertThat("yound before", event.getYoung().getPreUsed(), is(4096 + 80 * 1024));
    assertThat("tenured", event.getTenured().getTotal(), is(12 * 1024 * 1024 - 612 * 1024));
    assertThat("metaspace", event.getPerm().getTotal(), is(1140736));
    assertThat("perm", model.getPermAllocatedSizes().getN(), is(1));
    assertThat("warning count", handler.getCount(), is(0));
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) GCResource(com.tagtraum.perf.gcviewer.model.GCResource) 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 10 with GCResource

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

the class TestDataReaderSun1_8_0G1 method printGCCauseTenuringDistribution.

@Test
public void printGCCauseTenuringDistribution() throws Exception {
    TestLogHandler handler = new TestLogHandler();
    handler.setLevel(Level.WARNING);
    GCResource gcResource = new GcResourceFile("SampleSun1_8_0G1PrintGCCausePrintTenuringDistribution.txt");
    gcResource.getLogger().addHandler(handler);
    DataReader reader = getDataReader(gcResource);
    GCModel model = reader.read();
    assertEquals("gc pause sum", 16.7578613, model.getPause().getSum(), 0.000000001);
    assertEquals("number of errors", 0, handler.getCount());
}
Also used : GCResource(com.tagtraum.perf.gcviewer.model.GCResource) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Aggregations

GCResource (com.tagtraum.perf.gcviewer.model.GCResource)65 GcResourceFile (com.tagtraum.perf.gcviewer.model.GcResourceFile)55 Test (org.junit.Test)54 GCModel (com.tagtraum.perf.gcviewer.model.GCModel)40 ByteArrayInputStream (java.io.ByteArrayInputStream)15 GCEvent (com.tagtraum.perf.gcviewer.model.GCEvent)13 GcResourceSeries (com.tagtraum.perf.gcviewer.model.GcResourceSeries)10 InputStream (java.io.InputStream)9 ArrayList (java.util.ArrayList)8 File (java.io.File)4 GCModelLoader (com.tagtraum.perf.gcviewer.ctrl.GCModelLoader)2 LogRecord (java.util.logging.LogRecord)2 GCModelLoaderGroupTracker (com.tagtraum.perf.gcviewer.ctrl.GCModelLoaderGroupTracker)1 Before (org.junit.Before)1 Ignore (org.junit.Ignore)1