Package com.jitlogic.zorka.core.spy

Examples of com.jitlogic.zorka.core.spy.SpyDefinition


        if (ZorkaLogger.isLogLevel(ZorkaLogger.ZSP_ARGPROC)) {
            log.debug(ZorkaLogger.ZSP_ARGPROC, "Dispatching collector record: " + record);
        }

        SpyDefinition sdef = ((SpyContext) record.get(".CTX")).getSpyDefinition();

        for (SpyProcessor processor : sdef.getProcessors((Integer) record.get(".STAGE"))) {
            try {
                if (null == (record = processor.process(record))) {
                    break;
                }
            } catch (Exception e) {
View Full Code Here


public class SpyInstanceIntegTest extends ZorkaFixture {

    @Test
    public void testTrivialMethodRun() throws Exception {
        SpyDefinition sdef = spy.instrument("x")
                .include(spy.byMethod(BytecodeInstrumentationFixture.TCLASS1, "trivialMethod"))
                .onSubmit(spy.zorkaStats("test", "test:name=${shortClassName}", "stats", "${methodName}"));

        agentInstance.getClassTransformer().add(sdef);
View Full Code Here

        submitter = new DispatchingSubmitter(engine);
    }

    @Test
    public void testSubmitWithImmediateFlagAndCheckIfCollected() throws Exception {
        SpyDefinition sdef = engine.add(
                spy.instance("x").onEnter(spy.fetchTime("E0"))).onSubmit(collector);
        SpyContext ctx = engine.lookup(new SpyContext(sdef, "com.TClass", "tMethod", "()V", 1));

        submitter.submit(ON_ENTER, ctx.getId(), SF_IMMEDIATE, new Object[]{1L});
View Full Code Here

    }


    @Test
    public void testSubmitWithBufferAndFlush() throws Exception {
        SpyDefinition sdef = engine.add(spy.instrument("x").onSubmit(collector));
        SpyContext ctx = engine.lookup(new SpyContext(sdef, "Class", "method", "()V", 1));

        submitter.submit(ON_ENTER, ctx.getId(), SF_NONE, new Object[]{1L});
        assertEquals(0, collector.size());
View Full Code Here

    }


    @Test
    public void testSubmitAndCheckOnCollectBuf() throws Exception {
        SpyDefinition sdef = engine.add(spy.instance("x").onEnter(collector));
        SpyContext ctx = engine.lookup(new SpyContext(sdef, "Class", "method", "()V", 1));

        submitter.submit(ON_ENTER, ctx.getId(), SF_IMMEDIATE, new Object[]{1L});

        assertEquals(1, collector.size());
View Full Code Here

    }


    @Test
    public void testSubmitAndCheckSubmitBuffer() throws Exception {
        SpyDefinition sdef = engine.add(spy.instrument("x").onSubmit(collector));
        SpyContext ctx = engine.lookup(new SpyContext(sdef, "Class", "method", "()V", 1));

        submitter.submit(ON_ENTER, ctx.getId(), SF_NONE, new Object[]{1L});
        submitter.submit(ON_RETURN, ctx.getId(), SF_FLUSH, new Object[]{2L});
View Full Code Here

    }


    @Test
    public void testSpyInstrumentConvenienceFn1() {
        SpyDefinition sdef = spyLib.instrument("test", "test:type=MyStats", "stats", "${0}");

        assertEquals(2, sdef.getProcessors(SpyLib.ON_SUBMIT).size());
        Object coll = sdef.getProcessors(SpyLib.ON_SUBMIT).get(1);
        assertEquals("${A0}", ObjectInspector.getField(coll, "statTemplate"));
        assertEquals(2, sdef.getProbes(SpyLib.ON_ENTER).size());
        assertEquals("A0", sdef.getProbes(SpyLib.ON_ENTER).get(0).getDstField());
    }
View Full Code Here

    }


    @Test
    public void testSpyInstrumentConvenienceFnWithActualRemap() {
        SpyDefinition sdef = spyLib.instrument("test", "test:type=MyStats", "stats", "${1}");

        assertEquals(2, sdef.getProcessors(SpyLib.ON_SUBMIT).size());
        Object coll = sdef.getProcessors(SpyLib.ON_SUBMIT).get(1);
        assertEquals("${A1}", ObjectInspector.get(coll, "statTemplate"));
    }
View Full Code Here

    }


    @Test
    public void testSpyInstrumentConvenienceFnWithSingleMultipartVar() {
        SpyDefinition sdef = spyLib.instrument("test", "test:type=MyStats", "stats", "${0.request.url}");

        assertEquals(2, sdef.getProcessors(SpyLib.ON_SUBMIT).size());
        Object coll = sdef.getProcessors(SpyLib.ON_SUBMIT).get(1);
        assertEquals("${A0.request.url}", ObjectInspector.get(coll, "statTemplate"));
    }
View Full Code Here

    }


    @Test
    public void testSpyInstrumentConvenienceFnWithNonTranslatedVar() {
        SpyDefinition sdef = spyLib.instrument("test", "test:type=MyStats", "stats", "${methodName}");

        assertEquals(2, sdef.getProcessors(SpyLib.ON_SUBMIT).size());
        Object coll = sdef.getProcessors(SpyLib.ON_SUBMIT).get(1);
        assertEquals("${methodName}", ObjectInspector.get(coll, "statTemplate"));
    }
View Full Code Here

TOP

Related Classes of com.jitlogic.zorka.core.spy.SpyDefinition

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.