Search in sources :

Example 36 with GcResourceFile

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

the class TestDataReaderIBM_J9_R28 method testSysGlobal.

@Test
public void testSysGlobal() throws Exception {
    TestLogHandler handler = new TestLogHandler();
    handler.setLevel(Level.WARNING);
    GCResource gcResource = new GcResourceFile("SampleIBMJ9_R28_sys_global.txt");
    gcResource.getLogger().addHandler(handler);
    DataReader reader = getDataReader(gcResource);
    GCModel model = reader.read();
    assertThat("model size", model.size(), is(1));
    GCEvent event = (GCEvent) model.get(0);
    assertThat("pause", event.getPause(), closeTo(0.097756, 0.0000001));
    assertThat("type", event.getTypeAsString(), equalTo("sys explicit global; 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 37 with GcResourceFile

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

the class TestDataReaderIBM_J9_R28 method testAfGlobal.

@Test
public void testAfGlobal() throws Exception {
    TestLogHandler handler = new TestLogHandler();
    handler.setLevel(Level.WARNING);
    GCResource gcResource = new GcResourceFile("SampleIBMJ9_R28_af_global.txt");
    gcResource.getLogger().addHandler(handler);
    DataReader reader = getDataReader(gcResource);
    GCModel model = reader.read();
    assertThat("model size", model.size(), is(1));
    GCEvent event = (GCEvent) model.get(0);
    assertThat("pause", event.getPause(), closeTo(1.255648, 0.0000001));
    assertThat("type", event.getTypeAsString(), equalTo("af global; 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 38 with GcResourceFile

use of com.tagtraum.perf.gcviewer.model.GcResourceFile 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 39 with GcResourceFile

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

the class TestDataReaderFactory method testJRockit1_4GenConBig.

@Test
public void testJRockit1_4GenConBig() throws Exception {
    String fileName = "SampleJRockit1_4_2gencon-big.txt";
    try (InputStream in = getInputStreamJRockit(fileName)) {
        DataReader reader = new DataReaderFactory().getDataReader(new GcResourceFile(fileName), in);
        assertDataReader(DataReaderJRockit1_5_0.class, reader.getClass());
    }
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) Test(org.junit.Test)

Example 40 with GcResourceFile

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

the class TestDataReaderFactory method testJRockit1_4GcReportGenCon.

@Test
public void testJRockit1_4GcReportGenCon() throws Exception {
    String fileName = "SampleJRockit1_4_2ts-gcreport-gencon.txt";
    try (InputStream in = getInputStreamJRockit(fileName)) {
        DataReader reader = new DataReaderFactory().getDataReader(new GcResourceFile(fileName), in);
        assertDataReader(DataReaderJRockit1_4_2.class, reader.getClass());
    }
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) Test(org.junit.Test)

Aggregations

GcResourceFile (com.tagtraum.perf.gcviewer.model.GcResourceFile)186 Test (org.junit.Test)178 GCModel (com.tagtraum.perf.gcviewer.model.GCModel)133 ByteArrayInputStream (java.io.ByteArrayInputStream)118 InputStream (java.io.InputStream)69 GCResource (com.tagtraum.perf.gcviewer.model.GCResource)55 GCEvent (com.tagtraum.perf.gcviewer.model.GCEvent)21 GcResourceSeries (com.tagtraum.perf.gcviewer.model.GcResourceSeries)11 File (java.io.File)8 ArrayList (java.util.ArrayList)6 GCViewerGuiController (com.tagtraum.perf.gcviewer.ctrl.impl.GCViewerGuiController)2 AbstractGCEvent (com.tagtraum.perf.gcviewer.model.AbstractGCEvent)2 LogRecord (java.util.logging.LogRecord)2 Matchers.containsString (org.hamcrest.Matchers.containsString)2 Matchers.isEmptyString (org.hamcrest.Matchers.isEmptyString)2 GCModelLoader (com.tagtraum.perf.gcviewer.ctrl.GCModelLoader)1 DataReader (com.tagtraum.perf.gcviewer.imp.DataReader)1 DataReaderFactory (com.tagtraum.perf.gcviewer.imp.DataReaderFactory)1 DoubleData (com.tagtraum.perf.gcviewer.math.DoubleData)1 IntData (com.tagtraum.perf.gcviewer.math.IntData)1