Package com.jitlogic.zorka.common.tracedata

Examples of com.jitlogic.zorka.common.tracedata.TraceMarker


    }


    public String getTraceLabel() {
        StringBuilder sb = new StringBuilder();
        TraceMarker m = getMarker();
        sb.append(m != null ? sym(m.getTraceId()) : "?");

        if (getAttrs() != null) {
            for (Map.Entry<Integer, Object> e : getAttrs().entrySet()) {
                sb.append('|');
                sb.append(e.getValue());
View Full Code Here



    @Test
    public void testReadWriteTraceRecordWithMarker() throws Exception {
        TraceRecord tr = tr("some.Class", "someMethod", "()V", 1, 0, TraceRecord.TRACE_BEGIN, 100);
        TraceMarker tm = new TraceMarker(tr, sid("TRACE"), 100L);
        tm.setFlags(TraceMarker.OVERFLOW_FLAG);
        tr.setMarker(tm);

        writer.write(tr);

        FressianReader reader = reader();

        Object obj = reader.readObject();

        Set<Integer> ids = new HashSet<Integer>();

        while (obj instanceof Symbol) {
            Symbol s = (Symbol) obj;
            assertThat(s.getId()).isEqualTo(sid(s.getName()));
            obj = reader.readObject();
            ids.add(s.getId());
        }

        TraceRecord tr2 = (TraceRecord) obj;
        assertThat(tr2.getFlags()).isEqualTo(TraceRecord.TRACE_BEGIN);

        TraceMarker tm2 = tr2.getMarker();

        assertThat(tm2).isNotNull();
        assertThat(tm2.getFlags()).isEqualTo(TraceMarker.OVERFLOW_FLAG);
        assertThat(tm2.getClock()).isEqualTo(100L);
        assertThat(tm2.getTraceId()).isEqualTo(sid("TRACE"));

        assertThat(ids.size()).isEqualTo(symbols.size());

    }
View Full Code Here

        if (ttop.hasFlag(TraceRecord.TRACE_BEGIN)) {
            log.error(ZorkaLogger.ZTR_TRACE_ERRORS, "Trace marker already set on current frame. Skipping.");
            return;
        } else {
            ttop.setMarker(new TraceMarker(ttop, traceId, clock));
            ttop.markFlag(TraceRecord.TRACE_BEGIN);
            ttop.getMarker().markFlags(flags);
        }
    }
View Full Code Here

    }


    public void markTraceFlags(int traceId, int flag) {
        for (TraceRecord tr = realTop(); tr != null; tr = tr.getParent()) {
            TraceMarker tm = tr.getMarker();
            if (tm != null && (traceId == 0 || traceId == tm.getTraceId())) {
                tm.markFlags(flag);
                break;
            }
        }
    }
View Full Code Here

    }


    public boolean isInTrace(int traceId) {
        for (TraceRecord tr = realTop(); tr != null; tr = tr.getParent()) {
            TraceMarker tm = tr.getMarker();
            if (tm != null && tm.getTraceId() == traceId) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

TOP

Related Classes of com.jitlogic.zorka.common.tracedata.TraceMarker

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.