Search in sources :

Example 91 with GCModel

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

the class TestDataReaderIBM1_2_2 method testParse1.

@Test
public void testParse1() throws Exception {
    String fileName = "SampleIBM1_2_2.txt";
    InputStream in = UnittestHelper.getResourceAsStream(UnittestHelper.FOLDER_IBM, fileName);
    DataReader reader = new DataReaderIBM1_3_0(new GcResourceFile(fileName), in);
    GCModel model = reader.read();
    assertEquals("number of events", 28, model.size());
}
Also used : InputStream(java.io.InputStream) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 92 with GCModel

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

the class TestDataReaderIBM_J9_R27 method testFullHeaderWithAfGcs.

@Test
public void testFullHeaderWithAfGcs() throws Exception {
    TestLogHandler handler = new TestLogHandler();
    handler.setLevel(Level.WARNING);
    GCResource gcResource = new GcResourceFile("SampleIBMJ9_R27_SR1_full_header.txt");
    gcResource.getLogger().addHandler(handler);
    DataReader reader = getDataReader(gcResource);
    GCModel model = reader.read();
    assertThat("model size", model.size(), is(3));
    GCEvent event = (GCEvent) model.get(0);
    assertThat("pause", event.getPause(), closeTo(0.042303, 0.0000001));
    assertThat("total before", event.getTotal(), is(toKiloBytes(1073741824)));
    assertThat("free before", event.getPreUsed(), is(toKiloBytes(1073741824 - 804158480)));
    assertThat("free after", event.getPostUsed(), is(toKiloBytes(1073741824 - 912835672)));
    assertThat("total young before", event.getYoung().getTotal(), is(toKiloBytes(268435456)));
    assertThat("young before", event.getYoung().getPreUsed(), is(toKiloBytes(268435456)));
    assertThat("young after", event.getYoung().getPostUsed(), is(toKiloBytes(268435456 - 108677192)));
    assertThat("total tenured before", event.getTenured().getTotal(), is(toKiloBytes(805306368)));
    assertThat("tenured before", event.getTenured().getPreUsed(), is(toKiloBytes(805306368 - 804158480)));
    assertThat("tenured after", event.getTenured().getPostUsed(), is(toKiloBytes(805306368 - 804158480)));
    assertThat("timestamp 1", event.getTimestamp(), closeTo(0.0, 0.0001));
    assertThat("timestamp 2", model.get(1).getTimestamp(), closeTo(1.927, 0.0001));
    assertThat("timestamp 3", model.get(2).getTimestamp(), closeTo(3.982, 0.0001));
    assertThat("number of errors", handler.getCount(), is(1));
}
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 93 with GCModel

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

the class AbstractGCModelLoaderImpl method doInBackground.

@Override
protected GCModel doInBackground() throws Exception {
    setProgress(0);
    final GCModel result;
    try {
        result = loadGcModel();
    } catch (DataReaderException | RuntimeException e) {
        Logger logger = getGcResource().getLogger();
        if (logger.isLoggable(Level.FINE)) {
            logger.log(Level.FINE, "Failed to load GCModel from " + getGcResource().getResourceName(), e);
        }
        throw e;
    }
    return result;
}
Also used : DataReaderException(com.tagtraum.perf.gcviewer.imp.DataReaderException) Logger(java.util.logging.Logger) GCModel(com.tagtraum.perf.gcviewer.model.GCModel)

Example 94 with GCModel

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

the class TestDataReaderHPUX1_2 method testParse1.

@Test
public void testParse1() throws Exception {
    String fileName = "SampleHP-UX1_3.txt";
    InputStream in = UnittestHelper.getResourceAsStream(UnittestHelper.FOLDER_HP, fileName);
    DataReader reader = new DataReaderHPUX1_2(new GcResourceFile(fileName), in);
    GCModel model = reader.read();
    assertEquals("number of events", 135, model.size());
}
Also used : InputStream(java.io.InputStream) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 95 with GCModel

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

the class TestDataReaderHPUX1_4_1 method testParse1.

@Test
public void testParse1() throws Exception {
    String fileName = "SampleHP-UX1_4_1.txt";
    final InputStream in = UnittestHelper.getResourceAsStream(UnittestHelper.FOLDER_HP, fileName);
    final DataReader reader = new DataReaderHPUX1_4_1(new GcResourceFile(fileName), in);
    GCModel model = reader.read();
    assertEquals("number of events", 4, model.size());
}
Also used : InputStream(java.io.InputStream) 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