@Override protected void onStop(long start) { super.onStop(start); notifyStopped(); }
@Override protected void onStart(long start) { super.onStart(start); notifyStarted(); }
/** * {@inheritDoc} * * <p> * Returns {@link #getTimeUsec()}. * </p> */ @Override public long longValue() { return getTimeUsec(); }
/** * Returns UsecTimestamp based on current time with microsecond precision/accuracy * * @return UsecTimestamp for current time * @see com.jkoolcloud.tnt4j.utils.Utils#currentTimeUsec */ public static UsecTimestamp now() { return new UsecTimestamp(); }
/** * Adds the specified UsecTimestamp to this one. * * @param other * timestamp to add to current one */ public void add(UsecTimestamp other) { add(other.msecs, other.usecs); }
/** * Indicates that application tracking event has started. * */ public void start() { operation.start(); }
/** * Indicates that application tracking event has ended. * */ public void stop() { 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); }
/** * Constructs a Property snapshot with the specified name and current time stamp. * * @param cat * snapshot category name * @param name * snapshot name */ public PropertySnapshot(String cat, String name) { this(cat, name, OpLevel.INFO, OpType.SNAPSHOT, UsecTimestamp.now()); }
@Override public void setGUID(String uid) { operation.setGUID(uid); } }
/** * Returns the string representation of the timestamp based on the default format pattern, microseconds. * * @param usecs * microseconds * @return formatted date/time string based on pattern */ public static String getTimeStamp(long usecs) { long msecs = usecs / 1000L; return getTimeStamp(null, msecs, (usecs - msecs * 1000)); }
/** * Create a default filter with {@link OpLevel#INFO} as default threshold. * */ public EventLevelTimeFilter() { minLevel = OpLevel.INFO.ordinal(); }
/** * {@inheritDoc} */ @Override public void setParentId(Trackable parentObject) { this.parentId = parentObject != null ? parentObject.getTrackingId() : parentId; }
/** * Creates UsecTimestamp based on specified microsecond timestamp. * * @param usecTime * timestamp, in microsecond * @throws IllegalArgumentException * if usecTime is negative */ public UsecTimestamp(long usecTime) { setTimeUsec(usecTime); }
/** * {@inheritDoc} * * <p> * Returns {@link #getTimeUsec()} as a double. * </p> */ @Override public double doubleValue() { return getTimeUsec(); }
/** * 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); }
/** * 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); }
/** * {@inheritDoc} * * <p> * Returns {@link #getTimeUsec()} as an int, possibly truncated. * </p> */ @Override public int intValue() { return (int) getTimeUsec(); }
/** * 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); }
/** * Indicates that the operation has stopped at the specified stop time. * * @param stopTimeUsec * stop time, in microseconds * @throws IllegalArgumentException * if stopTime is negative, or if the stop time is less than the previously specified start time */ public void stop(long stopTimeUsec) { stop(stopTimeUsec, 0); }