Search in sources :

Example 41 with GCModel

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

the class TestDataReaderSun1_6_0 method testPrintTenuringDistribution.

@Test
public void testPrintTenuringDistribution() throws Exception {
    ByteArrayInputStream in = new ByteArrayInputStream(("2011-02-14T13:15:24.164+0100: 31581.748: [GC 31581.748: [ParNew" + "\nDesired survivor size 5963776 bytes, new threshold 1 (max 4)" + "\n- age   1:    8317928 bytes,    8317928 total" + "\n: 92938K->8649K(104832K), 0.0527364 secs] 410416K->326127K(1036928K), 0.0533874 secs] [Times: user=0.46 sys=0.09, real=0.05 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("event pause", 0.0533874, model.getGCPause().getMax(), 0.0000001);
    assertEquals("promotion", 0, model.getPromotion().getMax());
}
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 42 with GCModel

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

the class TestDataReaderSun1_6_0 method testPrintCmsStatistics.

@Test
public void testPrintCmsStatistics() throws Exception {
    // will not be able to extract sense from this line, but must not loop
    ByteArrayInputStream in = new ByteArrayInputStream(("0.521: [GC[YG occupancy: 2234 K (14784 K)]0.522: [Rescan (parallel)  (Survivor:0chunks) Finished young gen rescan work in 1th thread: 0.000 sec").getBytes());
    DataReader reader = new DataReaderSun1_6_0(new GcResourceFile("byteArray"), in, GcLogType.SUN1_6);
    GCModel model = reader.read();
    assertEquals("GC count", 0, model.size());
}
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 43 with GCModel

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

the class TestDataReaderSun1_6_0 method testFullGcIncrementalTimestamp.

@Test
public void testFullGcIncrementalTimestamp() throws Exception {
    ByteArrayInputStream in = new ByteArrayInputStream(("42927.215: [Full GC 42927.215: [CMS42927.255: [CMS-concurrent-sweep: 0.416/6.288 secs] [Times: user=17.38 sys=0.44, real=6.29 secs]" + "\n (concurrent mode failure): 262166K->215967K(785256K), 7.8308614 secs] 273998K->215967K(800040K), [CMS Perm : 523009K->155678K(524288K)] icms_dc=8 , 7.8320634 secs] [Times: user=4.59 sys=0.04, real=7.83 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("full gc pause", 7.8320634, 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 44 with GCModel

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

the class TestDataReaderSun1_6_0 method testCMSAbortingPrecleanTimestamp.

@Test
public void testCMSAbortingPrecleanTimestamp() throws Exception {
    ByteArrayInputStream in = new ByteArrayInputStream(" CMS: abort preclean due to time 12467.886: [CMS-concurrent-abortable-preclean: 5.300/5.338 secs] [Times: user=10.70 sys=0.13, real=5.34 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("gc pause", 5.3, model.getConcurrentGCEvents().next().getPause(), 0.001);
}
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 45 with GCModel

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

the class TestDataReaderSun1_6_0 method testCmsRemarkDatestamp.

@Test
public void testCmsRemarkDatestamp() throws Exception {
    ByteArrayInputStream in = new ByteArrayInputStream(("2011-10-05T04:23:39.427+0200: 13455.879: [GC[YG occupancy: 325751 K (471872 K)]13455.879: [Rescan (parallel) , 1.0591220 secs]13456.939: [weak refs processing, 0.0794109 secs] [1 CMS-remark: 1023653K(1572864K)] 1349404K(2044736K), 1.1490033 secs] [Times: user=19.09 sys=0.26, real=1.15 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("gc pause", 1.1490033, model.getGCPause().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)

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