/** * Indicates that application activity has ended. * * @param ex * exception associated with the activity or null if none. * @see ActivityStatus */ public void stop(Throwable ex) { stop((ex != null ? ActivityStatus.EXCEPTION : ActivityStatus.END), (ex != null ? OpCompCode.WARNING : OpCompCode.SUCCESS), ex, 0); }
/** * Indicates that application activity has ended normally without exception. * */ @Override public void stop() { stop(ActivityStatus.END, null, 0); }
/** * Indicates that application activity has ended normally without exception. * * @param elapsedUsec * elapsed time in microseconds */ @Override public void stop(long elapsedUsec) { stop(ActivityStatus.END, null, elapsedUsec); }
/** * Indicates that application activity has ended. * * @param status * status with which activity ended. * @param ex * exception associated with the activity or null if none. * @see ActivityStatus */ public void stop(ActivityStatus status, Throwable ex) { stop(status, (ex != null ? OpCompCode.WARNING : OpCompCode.SUCCESS), ex, 0); }
/** * Indicates that application activity has ended. * * @param ex * exception associated with the activity or null if none. * @param elapsedUsec * elapsed time in microseconds * @see ActivityStatus */ public void stop(Throwable ex, long elapsedUsec) { stop((ex != null ? ActivityStatus.EXCEPTION : ActivityStatus.END), (ex != null ? OpCompCode.WARNING : OpCompCode.SUCCESS), ex, elapsedUsec); }
/** * Indicates that application activity has ended. * * @param status * status with which activity ended. * @param ex * exception associated with the activity or null if none. * @param elapsedUsec * elapsed time in microseconds * @see ActivityStatus */ public void stop(ActivityStatus status, Throwable ex, long elapsedUsec) { stop(status, (ex != null ? OpCompCode.WARNING : OpCompCode.SUCCESS), ex, elapsedUsec); }
/** * Indicates that application activity has ended. * * @param status * status with which activity ended. * @param ccode * completion code of the activity. * @param ex * exception associated with the activity or null if none. * @see ActivityStatus * @see OpCompCode */ public void stop(ActivityStatus status, OpCompCode ccode, Throwable ex) { stop(status, ccode, ex, 0); }
private void reportActivity(TrackingActivity activity) throws IOException, URISyntaxException { try { if (!eventSink.isOpen()) { eventSink.open(); } } finally { if (!activity.isStopped()) { activity.stop(); } eventSink.log(activity); snapCount.addAndGet(activity.getSnapshotCount()); activityCount.incrementAndGet(); } }
/** * This method is called when activity ends Override this method to change behavior when activity ends. This method * also reports activity via configured {@code TrackingLogger} instance conditional upon {{@link #doSample()} * returning true. * * @return elapsed time of the activity in microseconds. */ protected long endActivity() { activity.stop(); if (doSample()) { logger.tnt(activity); } return activity.getElapsedTimeUsec(); }
if (attrs.get(PARAM_END_LABEL) != null && !activity.isNoop()) { activity.setStatus(ex != null ? ActivityStatus.EXCEPTION : ActivityStatus.END); activity.stop(ex); logger.tnt(activity); } else if (activityName != null) {
private void stopActivity() throws SAXException { long elapsed = simCurrTime.difference(curActivity.getStartTime()); curActivity.stop(simCurrTime, elapsed); TNT4JSimulator.debug(simCurrTime, "Stopped activity " + curActivity.getName() + ", elapsed.usec: " + elapsed); if (curActivity.getStatus() == ActivityStatus.BEGIN) { curActivity.setStatus(ActivityStatus.END); } Tracker tracker = trackers.get(curActivity.getSource().getFQName()); if (tracker != null) { tracker.tnt(curActivity); try { tracker.getEventSink().flush(); } catch (IOException e) { TNT4JSimulator.warn("Failed flushing event sink on stop of activity " + curActivity.getName(), e); } } curActivity = activeActivities.pop(); curActivityStart = null; curTracker = null; }
activity.setStatus(ex != null ? ActivityStatus.EXCEPTION : ActivityStatus.END); activity.tnt(tev); activity.stop(tev.getOperation().getEndTime().getTimeUsec(), 0); logger.tnt(activity); lastSnapshot = lastReport; activity.setException(ex); activity.setStatus(ex != null ? ActivityStatus.EXCEPTION : ActivityStatus.END); activity.stop(); logger.tnt(activity);