Search in sources :

Example 96 with GCModel

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

the class TestDataReaderIBM1_3_1 method testParse1.

@Test
public void testParse1() throws Exception {
    String fileName = "SampleIBM1_3_1.txt";
    InputStream in = UnittestHelper.getResourceAsStream(UnittestHelper.FOLDER_IBM, fileName);
    DataReader reader = new DataReaderIBM1_3_1(new GcResourceFile(fileName), in);
    GCModel model = reader.read();
    assertEquals("number of events", 21, 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 97 with GCModel

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

the class TestDataReaderIBM1_4_2 method testParse1.

@Test
public void testParse1() throws Exception {
    String fileName = "SampleIBM1_4_2.txt";
    final InputStream in = UnittestHelper.getResourceAsStream(UnittestHelper.FOLDER_IBM, fileName);
    final DataReader reader = new DataReaderIBM1_4_2(new GcResourceFile(fileName), in);
    GCModel model = reader.read();
    assertEquals("number of events", 2884, 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 98 with GCModel

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

the class TestDataReaderIBMJ9_5_0 method afTenuredGlobal.

@Test
public void afTenuredGlobal() throws Exception {
    final DataReader reader = getDataReader("SampleIBMJ9_5_0af-global-200811_07.txt");
    GCModel model = reader.read();
    assertEquals("count", 1, model.size());
    GCEvent event = (GCEvent) model.get(0);
    assertEquals("pause", 0.035912, event.getPause(), 0.0000001);
    assertEquals("timestamp", 0, event.getTimestamp(), 0.000001);
    assertEquals("name", Type.FULL_GC.getName(), event.getExtendedType().getName());
    assertEquals("before", (52428800 - 2621440) / 1024, event.getPreUsed());
    assertEquals("after", (52428800 - 40481192) / 1024, event.getPostUsed());
    assertEquals("total", 52428800 / 1024, event.getTotal());
}
Also used : GCEvent(com.tagtraum.perf.gcviewer.model.GCEvent) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 99 with GCModel

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

the class TestDataReaderIBMJ9_5_0 method afTenuredGlobal_20090417_AA.

@Test
public void afTenuredGlobal_20090417_AA() throws Exception {
    final DataReader reader = getDataReader("SampleIBMJ9_5_0af-global-20090417_AA.txt");
    GCModel model = reader.read();
    assertEquals("count", 1, model.size());
    GCEvent event = (GCEvent) model.get(0);
    assertEquals("pause", 0.837024, event.getPause(), 0.0000001);
    assertEquals("timestamp", 0, event.getTimestamp(), 0.000001);
    assertEquals("name", Type.FULL_GC.getName(), event.getExtendedType().getName());
    assertEquals("before", (12884901888L - 4626919608L) / 1024, event.getPreUsed());
    assertEquals("after", (12884901888L - 10933557088L) / 1024, event.getPostUsed());
    assertEquals("total", 12884901888L / 1024, event.getTotal());
}
Also used : GCEvent(com.tagtraum.perf.gcviewer.model.GCEvent) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 100 with GCModel

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

the class TestDataReaderIBM_J9_R26 method testFullHeaderWithAfGcs.

@Test
public void testFullHeaderWithAfGcs() throws Exception {
    TestLogHandler handler = new TestLogHandler();
    handler.setLevel(Level.WARNING);
    GCResource gcResource = new GcResourceFile("SampleIBMJ9_R26_GAFP1_full_header.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.00529, 0.0000001));
    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)

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