Search in sources :

Example 61 with GCResource

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

the class TestDataReaderSun1_6_0 method testCMSAdaptiveSizePolicy.

@Test
public void testCMSAdaptiveSizePolicy() throws Exception {
    TestLogHandler handler = new TestLogHandler();
    handler.setLevel(Level.WARNING);
    GCResource gcResource = new GcResourceFile("SampleSun1_6_0CMSAdaptiveSizePolicy.txt");
    gcResource.getLogger().addHandler(handler);
    InputStream in = getInputStream(gcResource.getResourceName());
    DataReader reader = new DataReaderSun1_6_0(gcResource, in, GcLogType.SUN1_6);
    GCModel model = reader.read();
    assertEquals("event count", 24, model.size());
    assertEquals("young gc count", 11, model.getGCPause().getN());
    assertEquals("full gc count", 1, model.getFullGCPause().getN());
    assertEquals("number of errors", 0, handler.getCount());
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) 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 62 with GCResource

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

the class TestDataReaderIBM_J9_R28 method testAfScavenge.

@Test
public void testAfScavenge() throws Exception {
    TestLogHandler handler = new TestLogHandler();
    handler.setLevel(Level.WARNING);
    GCResource gcResource = new GcResourceFile("SampleIBMJ9_R28_af_scavenge_full_header.txt");
    gcResource.getLogger().addHandler(handler);
    DataReader reader = getDataReader(gcResource);
    GCModel model = reader.read();
    assertThat("model size", model.size(), is(2));
    GCEvent event = (GCEvent) model.get(0);
    assertThat("pause", event.getPause(), closeTo(0.025388, 0.0000001));
    assertThat("total before", event.getTotal(), is(toKiloBytes(536870912)));
    assertThat("free before", event.getPreUsed(), is(toKiloBytes(536870912 - 401882552)));
    assertThat("free after", event.getPostUsed(), is(toKiloBytes(536870912 - 457545744)));
    assertThat("total young before", event.getYoung().getTotal(), is(toKiloBytes(134217728)));
    assertThat("young before", event.getYoung().getPreUsed(), is(toKiloBytes(134217728)));
    assertThat("young after", event.getYoung().getPostUsed(), is(toKiloBytes(134217728 - 55663192)));
    assertThat("total tenured before", event.getTenured().getTotal(), is(toKiloBytes(402653184)));
    assertThat("tenured before", event.getTenured().getPreUsed(), is(toKiloBytes(402653184 - 401882552)));
    assertThat("tenured after", event.getTenured().getPostUsed(), is(toKiloBytes(402653184 - 401882552)));
    assertThat("timestamp 1", event.getTimestamp(), closeTo(0.0, 0.0001));
    assertThat("timestamp 2", model.get(1).getTimestamp(), closeTo(1.272, 0.0001));
    assertThat("type", event.getTypeAsString(), equalTo("af scavenge; nursery; tenure"));
    assertThat("number of errors", handler.getCount(), is(0));
}
Also used : 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 63 with GCResource

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

the class TestDataReaderJRockit1_5_0 method testGcPrioPausetime.

@Test
public void testGcPrioPausetime() throws Exception {
    TestLogHandler handler = new TestLogHandler();
    handler.setLevel(Level.WARNING);
    GCResource gcResource = new GcResourceFile("SampleJRockit1_5_12_gcpriopausetime.txt");
    gcResource.getLogger().addHandler(handler);
    DataReader reader = getDataReader1_5(gcResource);
    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());
}
Also used : 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 64 with GCResource

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

the class TestDataReaderSun1_6_0G1 method logfileRollingProducesNoWarnings.

@Test
public void logfileRollingProducesNoWarnings() throws Exception {
    TestLogHandler handler = new TestLogHandler();
    handler.setLevel(Level.WARNING);
    GCResource gcResource = new GcResourceFile("SampleSun1_8_0RollingLogfile.txt");
    gcResource.getLogger().addHandler(handler);
    InputStream in = getInputStream(gcResource.getResourceName());
    DataReader reader = new DataReaderSun1_6_0G1(gcResource, in, GcLogType.SUN1_6G1);
    reader.read();
    assertThat("number of errors", handler.getCount(), is(0));
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) GCResource(com.tagtraum.perf.gcviewer.model.GCResource) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) Test(org.junit.Test)

Example 65 with GCResource

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

the class TestDataReaderJRockit1_6_0 method testGenParVerboseNursery.

@Test
public void testGenParVerboseNursery() throws Exception {
    TestLogHandler handler = new TestLogHandler();
    handler.setLevel(Level.WARNING);
    GCResource gcResource = new GcResourceFile("SampleJRockit1_6_33_gc_mode_genpar_verbosenursery.txt");
    gcResource.getLogger().addHandler(handler);
    DataReader reader = getDataReader(gcResource);
    GCModel model = reader.read();
    assertEquals("count", 3, model.size());
    GCEvent event = (GCEvent) model.get(0);
    assertEquals("timestamp", 124.644, event.getTimestamp(), 0.000001);
    assertEquals("name", Type.JROCKIT_16_YOUNG_GC.getName(), event.getExtendedType().getName());
    assertEquals("before", 453996, event.getPreUsed());
    assertEquals("after", 188846, event.getPostUsed());
    assertEquals("total", 786432, event.getTotal());
    assertEquals("pause", 0.055369, event.getPause(), 0.0000001);
    // generational algorithms have information about the generation sizing in the introduction of the gc log
    // -> check that it is present in the event
    event = event.getYoung();
    assertEquals("total", 393216, event.getTotal());
    event = (GCEvent) model.get(2);
    assertEquals("timestamp", 148.254, event.getTimestamp(), 0.000001);
    assertEquals("name", Type.JROCKIT_16_OLD_GC.getName(), event.getExtendedType().getName());
    assertEquals("before", 691255, event.getPreUsed());
    assertEquals("after", 279876, event.getPostUsed());
    assertEquals("total", 786432, event.getTotal());
    assertEquals("pause", 0.086713, event.getPause(), 0.0000001);
    // generational algorithms have information about the generation sizing in the introduction of the gc log
    // -> check that it is present in the event
    GCEvent eventTenured = event.getTenured();
    assertEquals("total", 786432 - 393216, eventTenured.getTotal());
    GCEvent eventYoung = event.getYoung();
    assertEquals("total", 393216, eventYoung.getTotal());
    assertEquals("number of warnings", 0, handler.getCount());
}
Also used : 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)

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