示例#1
0
 /**
  * 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);
 }
示例#2
0
 /**
  * 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
       + "}";
 }
示例#3
0
 /**
  * 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);
 }
示例#4
0
 /**
  * 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);
 }
示例#5
0
 @Override
 public long getTTL() {
   return operation.getTTL();
 }
示例#6
0
 /**
  * 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);
 }
示例#7
0
 /**
  * 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);
 }
示例#8
0
 /**
  * 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);
 }
示例#9
0
 @Override
 public void setCorrelator(Collection<String> cids) {
   operation.setCorrelator(cids);
 }
示例#10
0
 @Override
 public void setCorrelator(String... cids) {
   operation.setCorrelator(cids);
 }
示例#11
0
 /**
  * Return current severity level associated with this event
  *
  * @return severity level
  */
 public OpLevel getSeverity() {
   return operation.getSeverity();
 }
示例#12
0
 /**
  * Determine if operation was ever stopped
  *
  * @return true if operation was stopped, false otherwise
  */
 public boolean isStopped() {
   return operation.isStopped();
 }
示例#13
0
 /**
  * Determine if operation was ever started
  *
  * @return true if operation was started, false otherwise
  */
 public boolean isStarted() {
   return operation.isStarted();
 }
示例#14
0
 /**
  * Returns true of operation is a NOOP
  *
  * @return true if operation is a NOOP, false otherwise
  */
 public boolean isNoop() {
   return operation.isNoop();
 }
示例#15
0
 /** Indicates that application tracking event has ended. */
 public void stop() {
   operation.stop();
 }
示例#16
0
 /**
  * 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);
 }
示例#17
0
 @Override
 public Set<String> getCorrelator() {
   return operation.getCorrelator();
 }
示例#18
0
 /**
  * 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);
 }
示例#19
0
 /**
  * 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();
 }
示例#20
0
 /**
  * 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);
 }
示例#21
0
 /**
  * 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);
 }
示例#22
0
 /**
  * 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();
 }
示例#23
0
 /**
  * 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);
 }
示例#24
0
 @Override
 public OpType getType() {
   return operation.getType();
 }
示例#25
0
 /**
  * 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);
 }
示例#26
0
 @Override
 public void setTTL(long ttl) {
   operation.setTTL(ttl);
 }
示例#27
0
 /** Indicates that application tracking event has started. */
 public void start() {
   operation.start();
 }