Search in sources :

Example 51 with GCModel

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

the class ModelMetricsPanelTest method testTwoElementsModel.

@Test
public void testTwoElementsModel() {
    GCModel model = new GCModel();
    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);
    model.add(event);
    event = new GCEvent();
    event.setTimestamp(0.75);
    event.setType(Type.G1_YOUNG_INITIAL_MARK);
    event.setPause(0.245);
    event.setPreUsed(800);
    event.setPostUsed(300);
    event.setTotal(1024);
    model.add(event);
    ModelMetricsPanel panel = new ModelMetricsPanel();
    panel.setModel(model);
}
Also used : GCEvent(com.tagtraum.perf.gcviewer.model.GCEvent) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 52 with GCModel

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

the class ModelMetricsPanelTest method testEmptyModel.

@Test
public void testEmptyModel() {
    GCModel model = new GCModel();
    ModelMetricsPanel panel = new ModelMetricsPanel();
    panel.setModel(model);
}
Also used : GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 53 with GCModel

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

the class ModelMetricsPanelTest method testVmOpModel.

@Test
public void testVmOpModel() {
    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);
    VmOperationEvent vmOpEvent = new VmOperationEvent();
    vmOpEvent.setTimestamp(0.7);
    vmOpEvent.setType(Type.APPLICATION_STOPPED_TIME);
    vmOpEvent.setPause(0.26);
    model.add(vmOpEvent);
    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 : VmOperationEvent(com.tagtraum.perf.gcviewer.model.VmOperationEvent) GCEvent(com.tagtraum.perf.gcviewer.model.GCEvent) GCModel(com.tagtraum.perf.gcviewer.model.GCModel) Test(org.junit.Test)

Example 54 with GCModel

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

the class TestDataReaderSun1_6_0 method testPrintCmsStatisticsRemark.

@Test
public void testPrintCmsStatisticsRemark() throws Exception {
    ByteArrayInputStream in = new ByteArrayInputStream(("2012-10-20T18:04:59.443+0200: 2.918: [GC[YG occupancy: 8752 K (78656 K)]2.918: [Rescan (parallel)  (Survivor:1chunks) Finished young gen rescan work in 2th thread: 0.000 sec" + "\nFinished young gen rescan work in 1th thread: 0.000 sec" + "\nFinished young gen rescan work in 0th thread: 0.000 sec" + "\nFinished remaining root rescan work in 1th thread: 0.000 sec" + "\nFinished remaining root rescan work in 2th thread: 0.000 sec" + "\nFinished remaining root rescan work in 0th thread: 0.000 sec" + "\nFinished dirty card rescan work in 0th thread: 0.001 sec" + "\nFinished dirty card rescan work in 2th thread: 0.001 sec" + "\nFinished dirty card rescan work in 1th thread: 0.001 sec" + "\nFinished young gen rescan work in 3th thread: 0.000 sec" + "\nFinished remaining root rescan work in 3th thread: 0.000 sec" + "\nFinished dirty card rescan work in 3th thread: 0.000 sec" + "\nFinished work stealing in 3th thread: 0.000 sec" + "\nFinished work stealing in 2th thread: 0.000 sec" + "\nFinished work stealing in 0th thread: 0.000 sec" + "\nFinished work stealing in 1th thread: 0.000 sec" + "\n, 0.0008918 secs]2.919: [weak refs processing, 0.0000057 secs]2.919: [class unloading, 0.0001020 secs]2.919: [scrub symbol & string tables, 0.0003265 secs] [1 CMS-remark: 376134K(436928K)] 384886K(515584K), 0.0014952 secs] [Times: user=0.00 sys=0.00, real=0.00 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", 0.0014952, model.getGCPause().getMin(), 0.000000001);
}
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 55 with GCModel

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

the class TestDataReaderSun1_6_0 method testDerivedGenerationValues.

/**
     * Often only the young generation information is explicitly present. Old generation memory
     * size can be derived from heap - young size. This test checks for presence of derived memory
     * information.
     */
@Test
public void testDerivedGenerationValues() throws Exception {
    ByteArrayInputStream in = new ByteArrayInputStream("10.675: [GC [PSYoungGen: 21051K->4947K(22656K)] 23342K->7238K(67712K), 0.0191817 secs] [Times: user=0.09 sys=0.01, 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", 1, model.size());
    assertEquals("young used", 21051, model.getYoungUsedSizes().getMin());
    assertEquals("young allocated", 22656, model.getYoungAllocatedSizes().getMax());
    assertEquals("tenured used", 23342 - 21051, model.getTenuredUsedSizes().getMin());
    assertEquals("tenured allocated", 67712 - 22656, model.getTenuredAllocatedSizes().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)

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