Package com.tagtraum.perf.gcviewer.model

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


        DataReader reader = new DataReaderJRockit1_5_0(in);
        GCModel model = reader.read();
       
        assertEquals("count", 8, model.size());
       
        GCEvent event = (GCEvent) model.get(0);
        assertEquals("timestamp", 6.038, event.getTimestamp(), 0.000001);
        assertEquals("name", Type.JROCKIT_GC.getName(), event.getExtendedType().getName());
        assertEquals("before", 3089328, event.getPreUsed());
        assertEquals("after", 352551, event.getPostUsed());
        assertEquals("total", 3145728, event.getTotal());
        assertEquals("pause", 0.1186, event.getPause(), 0.0000001);
    }
View Full Code Here


        DataReader reader = new DataReaderJRockit1_5_0(in);
        GCModel model = reader.read();
       
        assertEquals("count", 5, model.size());
       
        GCEvent event = (GCEvent) model.get(0);
        assertEquals("timestamp", 6.771, event.getTimestamp(), 0.000001);
        assertEquals("name", Type.JROCKIT_GC.getName(), event.getExtendedType().getName());
        assertEquals("before", 3145728, event.getPreUsed());
        assertEquals("after", 296406, event.getPostUsed());
        assertEquals("total", 3145728, event.getTotal());
        assertEquals("pause", 0.066, event.getPause(), 0.0000001);
       
    }
View Full Code Here

        String line = "   [Eden: 1000K(2000K)->0B(3000K) Survivors: 1024B->4000K Heap: 5000K(16M)->6000K(16M)]";
       
        ParseInformation pos = new ParseInformation(0);
        pos.setIndex(line.indexOf("Heap:") + "Heap:".length() + 1);
       
        GCEvent event = new GCEvent();
        dataReader.setMemoryExtended(event, line, pos);
       
        assertEquals("heap before", 5000, event.getPreUsed());
        assertEquals("heap after", 6000, event.getPostUsed());
        assertEquals("heap total", 16*1024, event.getTotal());
    }
View Full Code Here

        String line = "   [ 8192K->8128K(64M)]";
       
        ParseInformation pos = new ParseInformation(0);
        pos.setIndex(line.indexOf("[") + 1);
       
        GCEvent event = new GCEvent();
        dataReader.setMemoryExtended(event, line, pos);
       
        assertEquals("heap before", 8192, event.getPreUsed());
        assertEquals("heap after", 8128, event.getPostUsed());
        assertEquals("heap total", 64*1024, event.getTotal());
    }
View Full Code Here

        String line = "   [Eden: 1000K(2000K)->0B(3000K) Survivors: 1024B->4000K Heap: 5000K(16M)->6000K(16M)]";
       
        ParseInformation pos = new ParseInformation(0);
        pos.setIndex(line.indexOf("Survivors:") + "Survivors:".length() + 1);
       
        GCEvent event = new GCEvent();
        dataReader.setMemoryExtended(event, line, pos);
       
        assertEquals("heap before", 1, event.getPreUsed());
        assertEquals("heap after", 4000, event.getPostUsed());
    }
View Full Code Here

        String line = "   [Eden: 118.5M(118.0M)->128.4K(112.0M) Survivors: 10.0M->16.0M Heap: 548.6M(640.0M)->440.6M(640.0M)]";
       
        ParseInformation pos = new ParseInformation(0);
        pos.setIndex(line.indexOf("Eden:") + "Eden:".length() + 1);
       
        GCEvent event = new GCEvent();
        dataReader.setMemoryExtended(event, line, pos);
       
        assertEquals("heap before", 121344, event.getPreUsed());
        assertEquals("heap after", 128, event.getPostUsed());
    }
View Full Code Here

    @Test
    public void testParse1() throws Exception {
        // original testcase was written with timestamp "2.23492e-006d" as first timestamp
        // I have never seen a timestamp writte in scientific format in the logfiles, so
        // I assume, that was some experiment here in the unittest
        AbstractGCEvent<GCEvent> event1 = new GCEvent(0, 8968, 8230, 10912, 0.0037192d, AbstractGCEvent.Type.GC);
        AbstractGCEvent<GCEvent> event2 = new GCEvent(1, 8968, 8230, 10912, 0.0037192d, AbstractGCEvent.Type.GC);
        AbstractGCEvent<GCEvent> event3 = new GCEvent(2, 8968, 8230, 10912, 0.0037192d, AbstractGCEvent.Type.GC);
        AbstractGCEvent<GCEvent> event4 = new GCEvent(3, 10753, 6046, 10912, 0.3146707d, AbstractGCEvent.Type.FULL_GC);
        AbstractGCEvent<GCEvent> event5 = new GCEvent(4, 10753, 6046, 10912, 0.3146707d, AbstractGCEvent.Type.INC_GC);
        AbstractGCEvent<GCEvent> event6 = new GCEvent(5, 52471, 22991, 75776, 1.0754938d, AbstractGCEvent.Type.GC);
        ByteArrayInputStream in = new ByteArrayInputStream("0.0: [GC 8968K->8230K(10912K), 0.0037192 secs]\r\n1.0: [GC 8968K->8230K(10912K), 0.0037192 secs]\r\n2.0: [GC 8968K->8230K(10912K), 0.0037192 secs]\r\n3.0: [Full GC 10753K->6046K(10912K), 0.3146707 secs]\r\n4.0: [Inc GC 10753K->6046K(10912K), 0.3146707 secs]\r\n5.0: [GC Desired survivor size 3342336 bytes, new threshold 1 (max 32) - age   1:  6684672 bytes,  6684672 total 52471K->22991K(75776K), 1.0754938 secs]".getBytes());
        final DataReader reader = new DataReaderSun1_6_0(in, GcLogType.SUN1_4);
        GCModel model = reader.read();
        assertEquals("model size", 6, model.size());
        Iterator<AbstractGCEvent<?>> i = model.getStopTheWorldEvents();
View Full Code Here

        1.030: [GC 745K->242K(1984K), 0.0043429 secs]
        1.378: [GC 753K->452K(1984K), 0.0094429 secs]
        2.499: [GC 964K->690K(1984K), 0.0108058 secs]
        2.831: [GC 1202K->856K(1984K), 0.0122599 secs]
        */
        AbstractGCEvent<GCEvent> event1 = new GCEvent(0.0d, 511, 180, 1984, 0.0095672d, AbstractGCEvent.Type.GC);
        AbstractGCEvent<GCEvent> event2 = new GCEvent(0.691d, 433, 233, 1984, 0.0056869d, AbstractGCEvent.Type.GC);
        AbstractGCEvent<GCEvent> event3 = new GCEvent(1.030d, 745, 242, 1984, 0.0043429d, AbstractGCEvent.Type.GC);
        AbstractGCEvent<GCEvent> event4 = new GCEvent(1.378d, 753, 452, 1984, 0.0094429d, AbstractGCEvent.Type.GC);
        AbstractGCEvent<GCEvent> event5 = new GCEvent(2.499d, 964, 690, 1984, 0.0108058d, AbstractGCEvent.Type.GC);
        AbstractGCEvent<GCEvent> event6 = new GCEvent(2.831d, 1202, 856, 1984, 0.0122599d, AbstractGCEvent.Type.GC);

        assertEquals("model size", 12, model.size());
        Iterator<GCEvent> i = model.getGCEvents();
        AbstractGCEvent<GCEvent> event = i.next();
        assertEquals("event 1", event, event1);
View Full Code Here

        0.000: [GC 0.000: [DefNew: 1534K->128K(1664K), 0.0082759 secs] 1534K->276K(16256K), 0.0084272 secs]
        11.653: [Full GC 11.653: [Tenured: 5634K->5492K(14592K), 0.2856516 secs] 6560K->5492K(16256K), 0.2858561 secs]
        22.879: [GC 22.879: [DefNew: 1855K->125K(1856K), 0.0099038 secs]22.889: [Tenured: 14638K->9916K(14720K), 0.8038262 secs] 16358K->9916K(16576K), 0.8142078 secs]
        31.788: [Full GC 31.788: [Tenured: 16141K->13914K(16528K), 0.8032950 secs] 17881K->13914K(18640K), 0.8036514 secs]
        */
        AbstractGCEvent<GCEvent> event1 = new GCEvent(0.0d, 1534, 276, 16256, 0.0084272d, AbstractGCEvent.Type.GC);
        event1.add(new GCEvent(0.0d, 1534, 128, 1664, 0.0082759d, AbstractGCEvent.Type.DEF_NEW));
        AbstractGCEvent<GCEvent> event2 = new GCEvent(11.653d, 6560, 5492, 16256, 0.2858561d, AbstractGCEvent.Type.FULL_GC);
        event2.add(new GCEvent(11.653d, 5634, 5492, 14592, 0.2856516d, AbstractGCEvent.Type.TENURED));
        AbstractGCEvent<GCEvent> event3 = new GCEvent(22.879d, 16358, 9916, 16576, 0.8142078d, AbstractGCEvent.Type.GC);
        event3.add(new GCEvent(22.879d, 1855, 125, 1856, 0.0099038d, AbstractGCEvent.Type.DEF_NEW));
        event3.add(new GCEvent(22.889d, 14638, 9916, 14720, 0.8038262d, AbstractGCEvent.Type.TENURED));
        AbstractGCEvent<GCEvent> event4 = new GCEvent(31.788d, 17881, 13914, 18640, 0.8036514d, AbstractGCEvent.Type.FULL_GC);
        event4.add(new GCEvent(31.788d, 16141, 13914, 16528, 0.8032950d, AbstractGCEvent.Type.TENURED));

        assertEquals("model.size()", 4, model.size());
        Iterator<AbstractGCEvent<?>> i = model.getStopTheWorldEvents();
        AbstractGCEvent<?> event = i.next();
        assertEquals("event 1", event1, event);
View Full Code Here

*/
public class TestDataReaderSun1_2_2 {

    @Test
    public void testParse1() throws Exception {
        AbstractGCEvent<GCEvent> event1 = new GCEvent(0, 817, 187, 819, 0.008, AbstractGCEvent.Type.GC);
        AbstractGCEvent<GCEvent> event2 = new GCEvent(0.02, 775, 188, 819, 0.005, AbstractGCEvent.Type.GC);
        AbstractGCEvent<GCEvent> event3 = new GCEvent(0.741, 1213, 1213, 1639, 0.0, AbstractGCEvent.Type.GC);
        ByteArrayInputStream in = new ByteArrayInputStream(("<GC: 0 milliseconds since last GC>\n" +
                "<GC: freed 2807 objects, 645224 bytes in 8 ms, 77% free (646672/838856)>\n" +
                "  <GC: init&scan: 0 ms, scan handles: 7 ms, sweep: 1 ms, compact: 0 ms>\n" +
                "  <GC: 0 register-marked objects, 4 stack-marked objects>\n" +
                "  <GC: 1 register-marked handles, 42 stack-marked handles>\n" +
                "  <GC: refs: soft 0 (age >= 32), weak 0, final 2, phantom 0>\n" +
                "<GC: managing allocation failure: need 2128 bytes, type=1, action=1>\n" +
                "<GC: 20 milliseconds since last GC>\n" +
                "<GC: freed 672 objects, 601032 bytes in 5 ms, 77% free (646040/838856)>\n" +
                "<GC: 721 milliseconds since last GC>\n" +
                "<GC: expanded object space by 839680 to 1678536 bytes, 74% free>\n").getBytes());
        DataReader reader = new DataReaderSun1_2_2(in);
        GCModel model = reader.read();
        assertEquals(3, model.size());
        Iterator<GCEvent> i = model.getGCEvents();
        GCEvent event = i.next();
        System.err.println(event.toString());
        assertEquals(event1, event);
        event = i.next();
        System.err.println(event.toString());
        assertEquals(event2, event);
        event = i.next();
        System.err.println(event.toString());
        assertEquals(event3, event);
    }
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.