/** * Indicates that application tracking event has ended. * * @param ccode completion code of the tracking event * @param rcode reason code associated with this tracking event * @param opEx exception associated with this tracking event * @param endTime time when the tracking event has ended (usec) * @param elpasedUsec elapsed time in (usec) * @see OpCompCode */ public void stop( OpCompCode ccode, int rcode, Throwable opEx, UsecTimestamp endTime, long elpasedUsec) { operation.setException(opEx); operation.setCompCode(ccode); operation.setReasonCode(rcode); operation.stop(endTime, elpasedUsec); }
/** * Return string representation of this tracking event * * @return string representation of the tracking event */ @Override public String toString() { return "{" + operation.getSeverity() + ",[" + getMessage() + "]," + "[" + operation.getName() + "]," + super.toString() + "," + operation + "}"; }
/** * Create a new instance of tracking event that can be timed and reported. * * @param tr tracker instance * @param src event source * @param severity severity level * @param opType operation type * @param opName operation name associated with this event (tracking event name) * @param correlator associated with this event (could be unique or passed from a correlated * activity) * @param tag associated with this event * @param msg binary message associated with this event * @param args argument list passed along side the message * @see OpLevel * @see OpType */ protected TrackingEvent( TrackerImpl tr, Source src, OpLevel severity, OpType opType, String opName, String correlator, String tag, byte[] msg, Object... args) { super(null, msg, args); tracker = tr; operation = new Operation(opName, opType); operation.setSeverity(severity); operation.setCorrelator(correlator); operation.setException(Utils.getThrowable(args)); setSource(src); setLocation(src); setTag(tag); }
/** * Indicates that application tracking event has started given a specific time stamp. * * @param time when operation started */ public void start(UsecTimestamp time) { operation.start(time); }
@Override public long getTTL() { return operation.getTTL(); }
/** * Indicates that application tracking event has ended. * * @param ccode completion code of the tracking event * @param rcode reason code associated with this tracking event * @see OpCompCode */ public void stop(OpCompCode ccode, int rcode) { operation.stop(); operation.setCompCode(ccode); operation.setReasonCode(rcode); }
/** * Indicates that application tracking event has ended. Event completion code is set to <code> * OpCompCode.WARNING</code> * * @param opEx exception associated with this tracking event */ public void stop(Throwable opEx) { operation.setException(opEx); operation.stop(); operation.setCompCode(opEx != null ? OpCompCode.WARNING : OpCompCode.SUCCESS); }
/** * Indicates that application tracking event has ended. * * @param elaspedTime elapsed time of this event in (usec) */ public void stop(long elaspedTime) { operation.stop(Useconds.CURRENT.get(), elaspedTime); }
@Override public void setCorrelator(Collection<String> cids) { operation.setCorrelator(cids); }
@Override public void setCorrelator(String... cids) { operation.setCorrelator(cids); }
/** * Return current severity level associated with this event * * @return severity level */ public OpLevel getSeverity() { return operation.getSeverity(); }
/** * Determine if operation was ever stopped * * @return true if operation was stopped, false otherwise */ public boolean isStopped() { return operation.isStopped(); }
/** * Determine if operation was ever started * * @return true if operation was started, false otherwise */ public boolean isStarted() { return operation.isStarted(); }
/** * Returns true of operation is a NOOP * * @return true if operation is a NOOP, false otherwise */ public boolean isNoop() { return operation.isNoop(); }
/** Indicates that application tracking event has ended. */ public void stop() { operation.stop(); }
/** * Indicates that application tracking event has ended. * * @param time when operation stopped * @param elapsedUsec elapsed time of the event in microseconds */ public void stop(UsecTimestamp time, long elapsedUsec) { operation.stop(time, elapsedUsec); }
@Override public Set<String> getCorrelator() { return operation.getCorrelator(); }
/** * Indicates that application tracking event has ended. * * @param endTimeUsec ending time associated with the event (usec) * @param elapsedUsec elapsed time in (usec) */ public void stop(long endTimeUsec, long elapsedUsec) { operation.stop(endTimeUsec, elapsedUsec); }
/** * Gets the location string associated with the tracking event such as GPS locator. * * @return location string for tracking event */ public String getLocation() { return operation.getLocation(); }
/** * Indicates that application tracking event has ended. Event completion code is set to <code> * OpCompCode.WARNING</code> * * @param opEx exception associated with this tracking event * @param elapsedUsec elapsed time in (usec) */ public void stop(Throwable opEx, long elapsedUsec) { operation.setException(opEx); operation.setCompCode(opEx != null ? OpCompCode.WARNING : OpCompCode.SUCCESS); operation.stop(Useconds.CURRENT.get(), elapsedUsec); }
/** * Sets the location associated with the tracking event such as GPS locator. * * @param location location string for tracking event */ public void setLocation(String location) { operation.setLocation(location); }
/** * Indicates that application tracking event has ended. * * @param ccode completion code of the tracking event * @param rcode reason code associated with this tracking event * @param opEx exception associated with this tracking event * @see OpCompCode */ public void stop(OpCompCode ccode, int rcode, Throwable opEx) { operation.setException(opEx); operation.setCompCode(ccode); operation.setReasonCode(rcode); operation.stop(); }
/** * Sets the location associated with the tracking event such as GPS locator. * * @param location location string for tracking event */ public void setLocation(Source location) { operation.setLocation(location); }
@Override public OpType getType() { return operation.getType(); }
/** * Indicates that application tracking event has started at the specified startTime * * @param startTimeUsc start time of the tracking event (usec) */ public void start(long startTimeUsc) { operation.start(startTimeUsc); }
@Override public void setTTL(long ttl) { operation.setTTL(ttl); }
/** Indicates that application tracking event has started. */ public void start() { operation.start(); }