Package com.tagtraum.perf.gcviewer.model

Examples of com.tagtraum.perf.gcviewer.model.GCModel


    @Theory
    public void shouldShowOrNotDateStampAccordingToModelAndSettings(TestCase testCase) throws Exception {
        //given
        ModelChartImpl modelChart = new ModelChartImpl();
        GCPreferences preferences = new GCPreferences();
        GCModel gcModel = Mockito.mock(GCModel.class);
        Mockito.when(gcModel.hasDateStamp()).thenReturn(testCase.hasDateStamp());
        Mockito.when(gcModel.getFirstDateStamp()).thenReturn(new Date());
        preferences.setShowDateStamp(testCase.isShowDateStamp());

        //when
        modelChart.setModel(gcModel, preferences);
View Full Code Here


*/
public class ModelPanelTest {
   
    @Test
    public void testEmptyModel() {
        GCModel model = new GCModel();
        ModelPanel panel = new ModelPanel();
        panel.setModel(model);
    }
View Full Code Here

        event.setPause(0.245);
        event.setPreUsed(900);
        event.setPostUsed(400);
        event.setTotal(1024);
       
        GCModel model = new GCModel();
        model.add(event);
       
        ModelPanel panel = new ModelPanel();
        panel.setModel(model);
    }
View Full Code Here

        panel.setModel(model);
    }

    @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);
       
        ModelPanel panel = new ModelPanel();
        panel.setModel(model);
    }
View Full Code Here

       
        ConcurrentGCEvent concGCEvent = new ConcurrentGCEvent();
        concGCEvent.setTimestamp(0.708);
        concGCEvent.setType(AbstractGCEvent.Type.CMS_CONCURRENT_MARK_START);
       
        gcModel = new GCModel();
        gcModel.add(gcEvent);
        gcModel.add(gcEvent2);
        gcModel.add(concGCEvent);
    }
View Full Code Here

                ("2012-07-26T14:58:54.045+0200: Total time for which application threads were stopped: 0.0078335 seconds" +
                        "\n3.634: [GC concurrent-root-region-scan-start]")
                .getBytes());
       
        final DataReader reader = new DataReaderSun1_6_0G1(in, GcLogType.SUN1_7G1);
        GCModel model = reader.read();

        assertThat("count", model.size(), is(2));
        assertThat("gc type (0)", model.get(0).getTypeAsString(), equalTo("Total time for which application threads were stopped"));
        assertThat("gc timestamp (0)", model.get(0).getTimestamp(), closeTo(0.0, 0.01));
        assertThat("gc type (1)", model.get(1).getTypeAsString(), equalTo("GC concurrent-root-region-scan-start"));
        assertThat("gc timestamp (1)", model.get(1).getTimestamp(), closeTo(3.634, 0.01));
        assertThat("number of errors", handler.getCount(), is(0));
    }
View Full Code Here

                 "\n2012-07-26T14:58:58.320+0200Application time: 0.0000221 seconds" +
                        "\n: 7.907: [GC concurrent-mark-start]")
                .getBytes());
       
        final DataReader reader = new DataReaderSun1_6_0G1(in, GcLogType.SUN1_7G1);
        GCModel model = reader.read();

        assertEquals("count", 2, model.size());
       
        assertThat("gc type (0)", "GC concurrent-root-region-scan-end", equalTo(model.get(0).getTypeAsString()));
        assertThat("gc timestamp (0)", model.get(0).getTimestamp(), closeTo(3.1, 0.01));
        assertThat("gc type (1)", "GC concurrent-mark-start", equalTo(model.get(1).getTypeAsString()));
       
        // should be 7.907, but line starts with ":", so timestamp of previous event is taken
        assertThat("gc timestamp (1)", model.get(1).getTimestamp(), closeTo(3.1, 0.0001));
        assertThat("number of errors", handler.getCount(), is(0));
    }
View Full Code Here

        event.setType(Type.G1_YOUNG_INITIAL_MARK);
        event.setTimestamp(0.5);
        event.setPause(0.2);
        // but no memory information -> all values zero there
       
        GCModel model = new GCModel();
        model.add(event);
       
        DoubleData initiatingOccupancyFraction = model.getCmsInitiatingOccupancyFraction();
        assertEquals("fraction", 0, initiatingOccupancyFraction.getSum(), 0.1);
    }
View Full Code Here

                ("0.197: [GC remark 0.197: [GC ref-proc, 0.0000070 secs], 0.0005297 secs]" +
                    "\n [Times: user=0.00 sys=0.00, real=0.00 secs]")
                .getBytes());
       
        final DataReader reader = new DataReaderSun1_6_0G1(in, GcLogType.SUN1_7G1);
        GCModel model = reader.read();

        assertEquals("count", 1, model.size());
        assertEquals("gc pause", 0.0005297, model.getGCPause().getMax(), 0.000001);
    }
View Full Code Here

                ("2013-09-08T22:11:22.639+0000: 52131.385: [GC remark 2013-09-08T22:11:22.640+0000: 52131.386: [GC ref-proc, 0.0120750 secs], 0.0347170 secs]\n" +
                        " [Times: user=0.43 sys=0.00, real=0.03 secs] \n")
                .getBytes());

        final DataReader reader = new DataReaderSun1_6_0G1(in, GcLogType.SUN1_7G1);
        GCModel model = reader.read();

        assertEquals("count", 1, model.size());
        assertEquals("gc pause", 0.0347170, model.getGCPause().getMax(), 0.000001);
    }
View Full Code Here

TOP

Related Classes of com.tagtraum.perf.gcviewer.model.GCModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.