Package com.tagtraum.perf.gcviewer.model

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


        final InputStream in = getInputStream("SampleSun1_7_0-02_G1_young.txt");
        final DataReader reader = new DataReaderSun1_6_0G1(in, GcLogType.SUN1_7G1);
        GCModel model = reader.read();
       
        assertEquals("gc pause", 0.14482200, model.getPause().getMax(), 0.000000001);
        GCEvent heap = (GCEvent) model.getEvents().next();
        assertEquals("heap before", 1105*1024, heap.getPreUsed());
        assertEquals("heap after", 380*1024, heap.getPostUsed());
        assertEquals("heap", 2*1024*1024, heap.getTotal());
       
        GCEvent young = model.getGCEvents().next().getYoung();
        assertNotNull("young", young);
        assertEquals("young before", 1024*1024, young.getPreUsed());
        assertEquals("young after", 128*1024, young.getPostUsed());
        assertEquals("young total", (896+128)*1024, young.getTotal());
       
        GCEvent tenured = model.getGCEvents().next().getTenured();
        assertNotNull("tenured", tenured);
        assertEquals("tenured before", (1105-1024)*1024, tenured.getPreUsed());
        assertEquals("tenured after", (380-128)*1024, tenured.getPostUsed());
        assertEquals("tenured total", 1024*1024, tenured.getTotal());
       
        assertEquals("number of errors", 0, handler.getCount());
    }
View Full Code Here


        final InputStream in = getInputStream("SampleSun1_7_0_02_G1_young_datestamp.txt");
        final DataReader reader = new DataReaderSun1_6_0G1(in, GcLogType.SUN1_7G1);
        GCModel model = reader.read();
       
        assertEquals("gc pause", 0.14482200, model.getPause().getMax(), 0.000000001);
        GCEvent heap = (GCEvent) model.getEvents().next();
        assertEquals("heap", 1105*1024, heap.getPreUsed());
        assertEquals("heap", 380*1024, heap.getPostUsed());
        assertEquals("heap", 2048*1024, heap.getTotal());
       
        assertEquals("number of errors", 0, handler.getCount());
    }
View Full Code Here

        final InputStream in = getInputStream("SampleSun1_7_0_12PrintAdaptiveSizePolicy.txt");
        final DataReader reader = new DataReaderSun1_6_0G1(in, GcLogType.SUN1_7G1);
        GCModel model = reader.read();

        assertEquals("gc pause", 0.158757, model.getPause().getMax(), 0.000000001);
        GCEvent heap = (GCEvent) model.getEvents().next();
        assertEquals("heap", 65*1024*1024, heap.getPreUsed());
        // test parsing of decimal values
        assertEquals("heap", 64.3*1024*1024, heap.getPostUsed(), 1e2);
        assertEquals("heap", 92.0*1024*1024, heap.getTotal(), 1e2);

        assertEquals("number of errors", 0, handler.getCount());
    }
View Full Code Here

        final InputStream in = getInputStream("SampleSun1_7_0_40PrintGCCause.txt");
        final DataReader reader = new DataReaderSun1_6_0G1(in, GcLogType.SUN1_7G1);
        GCModel model = reader.read();

        assertEquals("gc pause", 0.077938, model.getPause().getMax(), 0.000000001);
        GCEvent heap = (GCEvent) model.getEvents().next();
        assertEquals("heap", 32*1024, heap.getPreUsed());
        // test parsing of decimal values
        assertEquals("heap", 7136, (double)heap.getPostUsed(), 1e2);
        assertEquals("heap", 88.0*1024*1024, (double)heap.getTotal(), 1e2);

        assertEquals("number of errors", 0, handler.getCount());
    }
View Full Code Here

        final InputStream in = getInputStream("SampleSun1_7_0_40PrintGCCause2.txt");
        final DataReader reader = new DataReaderSun1_6_0G1(in, GcLogType.SUN1_7G1);
        GCModel model = reader.read();

        assertEquals("count", 1, model.size());
        GCEvent event = (GCEvent) model.get(0);
        assertEquals("type name", "GC pause (G1 Evacuation Pause) (young) (to-space exhausted)", event.getTypeAsString());
        assertEquals("gc pause", 0.0398848, model.getPause().getMax(), 0.000000001);
    }
View Full Code Here

        // there are (rarely) events, where the memory information could not be parsed,
        // because the line with the memory information was mixed with another event
        // looks like this:    [251.448:  213M->174M(256M)[GC concurrent-mark-start]
        // (produced using -XX:+PrintGcDetails -XX:+PrintHeapAtGC)

        GCEvent event = new GCEvent();
        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);
       
View Full Code Here

        GCModel model = reader.read();
       
        assertEquals("number of events", 9, model.size());
        assertEquals("number of concurrent events", 2, model.getConcurrentEventPauses().size());
       
        GCEvent youngEvent = (GCEvent) model.get(0);
        assertEquals("gc pause (young)", 0.00784501, youngEvent.getPause(), 0.000000001);
        assertEquals("heap (young)", 20 * 1024, youngEvent.getTotal());

        GCEvent partialEvent = (GCEvent) model.get(7);
        assertEquals("gc pause (partial)", 0.02648319, partialEvent.getPause(), 0.000000001);
        assertEquals("heap (partial)", 128 * 1024, partialEvent.getTotal());

        assertEquals("number of errors", 0, handler.getCount());
    }
View Full Code Here

        assertEquals("GC concurrent-root-region-scan-end expected", "GC concurrent-root-region-scan-end", concurrentEvent.getTypeAsString());

        concurrentEvent = (ConcurrentGCEvent) model.get(1);
        assertEquals("GC concurrent-mark-start expected", "GC concurrent-mark-start", concurrentEvent.getTypeAsString());

        GCEvent fullGcEvent = (GCEvent) model.get(2);
        assertEquals("full gc", "Full GC", fullGcEvent.getTypeAsString());

        assertEquals("number of errors", 0, handler.getCount());
    }
View Full Code Here

        final InputStream in = getInputStream("SampleSun1_7_0_40PrintHeapAtGC.txt");
        final DataReader reader = new DataReaderSun1_6_0G1(in, GcLogType.SUN1_7G1);
        GCModel model = reader.read();

        assertEquals("count", 1, model.size());
        GCEvent event = (GCEvent) model.get(0);
        assertEquals("type name", "GC pause (G1 Evacuation Pause) (young)", event.getTypeAsString());
        assertEquals("gc pause", 0.0147015, model.getPause().getMax(), 0.000000001);
        assertEquals("error count", 0, handler.getCount());
    }
View Full Code Here

        final InputStream in = getInputStream("SampleSun1_7_0G1AdaptiveSize_Reference.txt");
        final DataReader reader = new DataReaderSun1_6_0G1(in, GcLogType.SUN1_7G1);
        GCModel model = reader.read();
       
        assertThat("count", model.size(), is(3));
        GCEvent event = (GCEvent) model.get(0);
        assertThat("type name", event.getTypeAsString(), equalTo("GC pause (G1 Evacuation Pause) (young)"));
        assertThat("gc pause", event.getPause(), closeTo(0.0107924, 0.00000001));
       
        GCEvent event2 = (GCEvent) model.get(1);
        assertThat("type name 2", event2.getTypeAsString(), equalTo("GC pause (young)"));
        assertThat("gc pause 2", event2.getPause(), closeTo(0.0130642, 0.00000001));
       
        GCEvent event3 = (GCEvent) model.get(2);
        assertThat("type name 3", event3.getTypeAsString(), equalTo("GC remark; GC ref-proc"));
        assertThat("gc pause 3", event3.getPause(), closeTo(0.0013608, 0.00000001));

        assertThat("error count", handler.getCount(), is(0));
    }
View Full Code Here

TOP

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

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.