Search in sources :

Example 26 with GCModel

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

the class TestDataReaderSun1_6_0 method testFullGcIncrementalDatestamp2.

@Test
public void testFullGcIncrementalDatestamp2() throws Exception {
    ByteArrayInputStream in = new ByteArrayInputStream(("2011-10-05T04:23:39.427+0200: 44189.823: [Full GC 44189.824: [CMS: 274825K->223922K(892264K), 8.0594203 secs] 327565K->223922K(992616K), [CMS Perm : 524287K->158591K(524288K)] icms_dc=0 , 8.0600619 secs] [Times: user=4.51 sys=0.05, real=8.06 secs]").getBytes());
    DataReader reader = new DataReaderSun1_6_0(new GcResourceFile("byteArray"), in, GcLogType.SUN1_6);
    GCModel model = reader.read();
    assertEquals("GC count", 1, model.size());
    assertEquals("full gc pause", 8.0600619, 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 27 with GCModel

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

the class TestDataReaderSun1_6_0 method testCMSPromotionFailedPrintPromotionFailure.

@Test
public void testCMSPromotionFailedPrintPromotionFailure() throws Exception {
    ByteArrayInputStream in = new ByteArrayInputStream(("2012-03-26T21:46:32.546+0200: 2.204: [GC 2.204: [ParNew (0: promotion failure size = 4098)  (1: promotion failure size = 4098)  (2: promotion failure size = 4098)  (3: promotion failure size = 4098)  (promotion failed): 39277K->39255K(39296K), 0.0175749 secs]2.221: [CMS: 87276K->43438K(87424K), 0.0276222 secs] 95765K->43438K(126720K), [CMS Perm : 2612K->2612K(21248K)], 0.0453577 secs] [Times: user=0.08 sys=0.00, real=0.05 secs]").getBytes());
    DataReader reader = new DataReaderSun1_6_0(new GcResourceFile("byteArray"), in, GcLogType.SUN1_6);
    GCModel model = reader.read();
    assertEquals("gc type", "GC; ParNew (promotion failed); CMS; CMS Perm", model.getFullGCEvents().next().getTypeAsString());
}
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 28 with GCModel

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

the class TestDataReaderSun1_6_0 method testCMSConcurrentModeFailureDate.

@Test
public void testCMSConcurrentModeFailureDate() throws Exception {
    ByteArrayInputStream in = new ByteArrayInputStream(("2011-10-05T15:53:24.119+0200: 41403.025: [GC 41403.025: [ParNew (promotion failed): 104960K->101572K(104960K), 0.3275017 secs]41403.353: [CMS2011-10-05T15:53:24.629+0200: 41403.534: [CMS-concurrent-abortable-preclean: 1.992/2.650 secs] [Times: user=4.40 sys=0.06, real=2.65 secs]" + "\n (concurrent mode failure): 1295417K->906090K(1398144K), 32.4123146 secs] 1395643K->906090K(1503104K), [CMS Perm : 54986K->53517K(91576K)], 32.7410609 secs] [Times: user=33.10 sys=0.05, real=32.74 secs]").getBytes());
    DataReader reader = new DataReaderSun1_6_0(new GcResourceFile("byteArray"), in, GcLogType.SUN1_6);
    GCModel model = reader.read();
    assertEquals("GC count", 2, model.size());
    assertEquals("gc pause", 32.7410609, model.getFullGCPause().getMax(), 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 29 with GCModel

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

the class TestDataReaderSun1_6_0 method testCmsMemory.

@Test
public void testCmsMemory() throws Exception {
    String fileName = "SampleSun1_6_0CMS.txt";
    InputStream in = getInputStream(fileName);
    DataReader reader = new DataReaderSun1_6_0(new GcResourceFile(fileName), in, GcLogType.SUN1_6);
    GCModel model = reader.read();
    assertEquals("GC count", 41, model.size());
    assertEquals("heap min allocated", 249088, model.getHeapAllocatedSizes().getMin());
    assertEquals("heap max allocated", 249088, model.getHeapAllocatedSizes().getMax());
    assertEquals("young min allocated", 118016, model.getYoungAllocatedSizes().getMin());
    assertEquals("young max allocated", 118016, model.getYoungAllocatedSizes().getMax());
    assertEquals("tenured min allocated", 131072, model.getTenuredAllocatedSizes().getMin());
    assertEquals("tenured max allocated", 131072, model.getTenuredAllocatedSizes().getMax());
    assertEquals("perm min allocated", 21248, model.getPermAllocatedSizes().getMin());
    assertEquals("perm max allocated", 21248, model.getPermAllocatedSizes().getMax());
    assertEquals("heap min used", 80841, model.getHeapUsedSizes().getMin());
    assertEquals("heap max used", 209896, model.getHeapUsedSizes().getMax());
    assertEquals("young min used", 15160, model.getYoungUsedSizes().getMin());
    assertEquals("young max used", 118010, model.getYoungUsedSizes().getMax());
    assertEquals("tenured min used", 0, model.getTenuredUsedSizes().getMin());
    assertEquals("tenured max used", 115034, model.getTenuredUsedSizes().getMax());
    assertEquals("perm min used", 2560, model.getPermUsedSizes().getMin());
    assertEquals("perm max used", 2561, model.getPermUsedSizes().getMax());
    assertEquals("promotion avg", 16998.3846, model.getPromotion().average(), 0.0001);
    assertEquals("promotion total", 220979, model.getPromotion().getSum());
    assertThat("count tenured heap after full gc", model.getFootprintAfterFullGC().getN(), is(2));
    assertThat("max tenured heap after full gc", model.getFootprintAfterFullGC().getMax(), is(31297));
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) GcResourceFile(com.tagtraum.perf.gcviewer.model.GcResourceFile) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 30 with GCModel

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

the class TestDataReaderSun1_6_0 method testCMSWithoutPrintTimeStampConcurrentModeFailure.

@Test
public void testCMSWithoutPrintTimeStampConcurrentModeFailure() throws Exception {
    ByteArrayInputStream in = new ByteArrayInputStream(("2012-04-03T20:36:35.284+0200: [GC [ParNew: 19081K->19081K(19136K), 0.0000205 secs][CMS2012-04-03T20:36:35.285+0200: [CMS-concurrent-abortable-preclean: 0.005/0.150 secs] [Times: user=0.14 sys=0.14, real=0.15 secs]" + "\n (concurrent mode failure): 98182K->3832K(98624K), 0.0195864 secs] 117264K->3832K(117760K), [CMS Perm : 2614K->2613K(21248K)], 0.0199322 secs] [Times: user=0.02 sys=0.00, real=0.02 secs]").getBytes());
    DataReader reader = new DataReaderSun1_6_0(new GcResourceFile("byteArray"), in, GcLogType.SUN1_6);
    GCModel model = reader.read();
    assertEquals("GC count", 2, model.size());
    assertEquals("heap", 117760, model.getHeapAllocatedSizes().getMax());
    assertEquals("pause", 0.0199322, model.getFullGCPause().getMax(), 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)

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