Search in sources :

Example 46 with GCModel

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

the class TestDataReaderSun1_6_0 method testCMSFullGcCmsInterrupted.

@Test
public void testCMSFullGcCmsInterrupted() throws Exception {
    // TODO CMS (concurrent mode interrupted) not recognised (ignored)
    ByteArrayInputStream in = new ByteArrayInputStream("78.579: [Full GC (System) 78.579: [CMS (concurrent mode interrupted): 64171K->1538K(107776K), 0.0088356 secs] 75362K->1538K(126912K), [CMS Perm : 2554K->2554K(21248K)], 0.0089351 secs] [Times: user=0.00 sys=0.00, real=0.01 secs]".getBytes());
    DataReader reader = new DataReaderSun1_6_0(new GcResourceFile("byteArray"), in, GcLogType.SUN1_6);
    GCModel model = reader.read();
    assertEquals("count", 1, model.getPause().getN());
    assertEquals("full gc pause", 0.0089351, model.getFullGCPause().getSum(), 0.00000001);
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 47 with GCModel

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

the class TestDataReaderSun1_6_0 method testCMSPromotionFailed.

@Test
public void testCMSPromotionFailed() throws Exception {
    ByteArrayInputStream in = new ByteArrayInputStream(("2011-10-05T16:05:55.964+0200: 41985.374: [GC 41985.375: [ParNew (promotion failed): 104960K->100764K(104960K), 0.3379238 secs]41985.713: [CMS: 1239589K->897516K(1398144K), 38.3189415 secs] 1336713K->897516K(1503104K), [CMS Perm : 55043K->53511K(91736K)], 38.6583674 secs] [Times: user=39.22 sys=0.06, real=38.66 secs]").getBytes());
    DataReader reader = new DataReaderSun1_6_0(new GcResourceFile("byteArray"), in, GcLogType.SUN1_6);
    GCModel model = reader.read();
    assertEquals("gc pause", 38.6583674, model.getFullGCPause().getSum(), 0.000001);
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 48 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 49 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 50 with GCModel

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

the class ModelMetricsPanelTest method testOneElementModel.

@Test
public void testOneElementModel() {
    GCEvent event = new GCEvent();
    event.setTimestamp(0.5);
    event.setType(Type.G1_YOUNG_INITIAL_MARK);
    event.setPause(0.245);
    event.setPreUsed(900);
    event.setPostUsed(400);
    event.setTotal(1024);
    GCModel model = new GCModel();
    model.add(event);
    ModelMetricsPanel panel = new ModelMetricsPanel();
    // first add empty model; is done when opened
    panel.setModel(new GCModel());
    // only later a model with entries is set
    panel.setModel(model);
}
Also used : 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