Package org.drift.tracker

Examples of org.drift.tracker.Tracker


    }

    @Around("monitoredPoint()")
    public Object monitor(ProceedingJoinPoint pjp) throws Throwable {
        String trackerName = getTrackerName(pjp);
        Tracker tracker = TrackerFactory.getTracker(trackerName);

        MonitoredCall call = composeCall(pjp);
        tracker.registerCall(call);

        long start = System.currentTimeMillis();
        try {
            Object ret = pjp.proceed();
            long end = System.currentTimeMillis() - start;

            StringBuilder buf = new StringBuilder();
            buf.append("{monitor} " + call.getCall());
            if (call.logArgs) {
                buf.append(" with args " + Arrays.toString(call.args));
            }
            buf.append(" took " + end + " ms");
            return ret;
        } catch (Throwable t) {
            long end = System.currentTimeMillis() - start;
            StringBuilder buf = new StringBuilder();
            buf.append("Exception occurred while executing " + call.typeName + "." + call.methodName);
            if (call.logArgs) {
                buf.append(" with args [" + Arrays.toString(call.args) + "]");
            }
            buf.append("; took " + end + " ms");
            throw t;
        } finally {
            tracker.deregisterCall();
        }
    }
View Full Code Here


            indentor.newline();

            String trackerName = entry.getKey();
            indentor.append("Tracker: " + trackerName);

            Tracker tracker = entry.getValue();
            Map<Thread, Stack<CallInProgress>> map = tracker.getCalls();
            for (Map.Entry<Thread, Stack<CallInProgress>> threadEntry : map.entrySet()) {
                Thread thread = threadEntry.getKey();
                ThreadUtils.dumpThreadStatus(thread.getId(), indentor);

                Stack<CallInProgress> calls = threadEntry.getValue();
View Full Code Here

TOP

Related Classes of org.drift.tracker.Tracker

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.