Package com.jitlogic.zorka.core.spy.plugins

Examples of com.jitlogic.zorka.core.spy.plugins.ZorkaStatsCollector.process()


        SpyContext ctx = new SpyContext(spy.instance("x"), "TClass", "testMethod", "()V", 1);

        Map<String, Object> record = ZorkaUtil.map(".CTX", ctx, ".STAGE", ON_SUBMIT, ".STAGES", (1 << ON_RETURN), "T", 10L);

        collector.process(record);

        MethodCallStatistics stats = (MethodCallStatistics) getAttr(testMbs, "test:name=Test", "stats");

        assertNotNull(stats.getStatistic("test"));
    }
View Full Code Here


        SpyContext ctx = new SpyContext(spy.instance("x"), "TClass", "testMethod", "()V", 1);

        Map<String, Object> record = ZorkaUtil.map(".CTX", ctx, ".STAGE", ON_SUBMIT, ".STAGES", (1 << ON_RETURN), "T", 10L);

        collector.process(record);

        MethodCallStatistics stats = (MethodCallStatistics) getAttr(testMbs, "test:name=Test", "stats");

        assertNotNull(stats.getStatistic("testMethod"));
    }
View Full Code Here

        SpyContext ctx = new SpyContext(spy.instance("x"), "some.TClass", "testMethod", "()V", 1);

        Map<String, Object> record = ZorkaUtil.map(".CTX", ctx, ".STAGE", ON_SUBMIT, ".STAGES", (1 << ON_RETURN), "T", 10L);

        collector.process(record);

        MethodCallStatistics stats = (MethodCallStatistics) getAttr(testMbs, "test:name=TClass", "stats");

        assertNotNull(stats.getStatistic("testMethod"));
    }
View Full Code Here

        SpyContext ctx = new SpyContext(spy.instance("x"), "some.TClass", "testMethod", "()V", 1);

        Map<String, Object> record = ZorkaUtil.map(".CTX", ctx, ".STAGE", ON_SUBMIT, ".STAGES", (1 << ON_RETURN), "T", 10L, "C1", "oja");

        collector.process(record);

        MethodCallStatistics stats = (MethodCallStatistics) getAttr(testMbs, "test:name=TClass", "stats");

        assertNotNull(stats.getStatistic("oja"));
    }
View Full Code Here

        SpyContext ctx = new SpyContext(spy.instance("x"), "some.TClass", "testMethod", "()V", 1);
        Map<String, Object> rec = ZorkaUtil.map(".CTX", ctx, ".STAGE", ON_SUBMIT, ".STAGES", (1 << ON_RETURN), "T", 1L);

        c1.process(rec);
        c2.process(rec);

        MethodCallStatistics stats = (MethodCallStatistics) getAttr(testMbs, "test:name=SomeBean", "stats");
        assertEquals(2L, ((MethodCallStatistic) stats.getStatistic("AAA")).getCalls());
    }
View Full Code Here

    public void testThroughputCounting() throws Exception {
        ZorkaStatsCollector c1 = new ZorkaStatsCollector(mBeanServerRegistry, "test", "test:name=SomeBean",
                "stats", "AAA", "T", "LEN", ZorkaStatsCollector.ACTION_STATS);

        SpyContext ctx = new SpyContext(spy.instance("x"), "some.TClass", "testMethod", "()V", 1);
        c1.process(ZorkaUtil.<String, Object>map(".CTX", ctx, ".STAGE", ON_SUBMIT, ".STAGES", (1 << ON_RETURN), "T", 1L, "LEN", 100));
        c1.process(ZorkaUtil.<String, Object>map(".CTX", ctx, ".STAGE", ON_SUBMIT, ".STAGES", (1 << ON_RETURN), "T", 1L, "LEN", 300));
        c1.process(ZorkaUtil.<String, Object>map(".CTX", ctx, ".STAGE", ON_SUBMIT, ".STAGES", (1 << ON_RETURN), "T", 1L, "LEN", 200));

        MethodCallStatistics stats = (MethodCallStatistics) getAttr(testMbs, "test:name=SomeBean", "stats");
        assertEquals(600L, ((MethodCallStatistic) stats.getStatistic("AAA")).getThroughput());
View Full Code Here

        ZorkaStatsCollector c1 = new ZorkaStatsCollector(mBeanServerRegistry, "test", "test:name=SomeBean",
                "stats", "AAA", "T", "LEN", ZorkaStatsCollector.ACTION_STATS);

        SpyContext ctx = new SpyContext(spy.instance("x"), "some.TClass", "testMethod", "()V", 1);
        c1.process(ZorkaUtil.<String, Object>map(".CTX", ctx, ".STAGE", ON_SUBMIT, ".STAGES", (1 << ON_RETURN), "T", 1L, "LEN", 100));
        c1.process(ZorkaUtil.<String, Object>map(".CTX", ctx, ".STAGE", ON_SUBMIT, ".STAGES", (1 << ON_RETURN), "T", 1L, "LEN", 300));
        c1.process(ZorkaUtil.<String, Object>map(".CTX", ctx, ".STAGE", ON_SUBMIT, ".STAGES", (1 << ON_RETURN), "T", 1L, "LEN", 200));

        MethodCallStatistics stats = (MethodCallStatistics) getAttr(testMbs, "test:name=SomeBean", "stats");
        assertEquals(600L, ((MethodCallStatistic) stats.getStatistic("AAA")).getThroughput());
        assertEquals(300L, ((MethodCallStatistic) stats.getStatistic("AAA")).getMaxThroughput());
View Full Code Here

                "stats", "AAA", "T", "LEN", ZorkaStatsCollector.ACTION_STATS);

        SpyContext ctx = new SpyContext(spy.instance("x"), "some.TClass", "testMethod", "()V", 1);
        c1.process(ZorkaUtil.<String, Object>map(".CTX", ctx, ".STAGE", ON_SUBMIT, ".STAGES", (1 << ON_RETURN), "T", 1L, "LEN", 100));
        c1.process(ZorkaUtil.<String, Object>map(".CTX", ctx, ".STAGE", ON_SUBMIT, ".STAGES", (1 << ON_RETURN), "T", 1L, "LEN", 300));
        c1.process(ZorkaUtil.<String, Object>map(".CTX", ctx, ".STAGE", ON_SUBMIT, ".STAGES", (1 << ON_RETURN), "T", 1L, "LEN", 200));

        MethodCallStatistics stats = (MethodCallStatistics) getAttr(testMbs, "test:name=SomeBean", "stats");
        assertEquals(600L, ((MethodCallStatistic) stats.getStatistic("AAA")).getThroughput());
        assertEquals(300L, ((MethodCallStatistic) stats.getStatistic("AAA")).getMaxThroughput());
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.