/** * {@inheritDoc} * * <p> * Returns {@link #getTimeUsec()}. * </p> */ @Override public long longValue() { return getTimeUsec(); }
/** * {@inheritDoc} * * <p> * Returns {@link #getTimeUsec()} as a double. * </p> */ @Override public double doubleValue() { return getTimeUsec(); }
/** * {@inheritDoc} * * <p> * Returns {@link #getTimeUsec()} as a float, possibly truncated. * </p> */ @Override public float floatValue() { return getTimeUsec(); }
/** * {@inheritDoc} * * <p> * Returns {@link #getTimeUsec()} as an int, possibly truncated. * </p> */ @Override public int intValue() { return (int) getTimeUsec(); }
/** * Indicates that the operation has started at the specified start time. * * @param startTimestamp * start time * @throws NullPointerException * if startTimestamp is {@code null} * @throws IllegalArgumentException * if startTimestamp is invalid */ public void start(UsecTimestamp startTimestamp) { if (startTimestamp == null) { throw new NullPointerException("startTimestamp must be non-null"); } start(startTimestamp.getTimeUsec()); }
/** * Indicates that the operation has stopped at the specified stop time. * * @param stopTimestamp * stop time * @param elaspedUsec * elapsed time in microseconds * @throws NullPointerException * if stopTimestamp is {@code null} * @throws IllegalArgumentException * if stopTimestamp is invalid */ public void stop(UsecTimestamp stopTimestamp, long elaspedUsec) { if (stopTimestamp == null) { throw new NullPointerException("stopTimestamp must be non-null"); } stop(stopTimestamp.getTimeUsec(), elaspedUsec); }
/** * Converts property value to string representation specific for JKool. * <ul> * <li>{@link Date} value is serialized as number using {@link java.util.Date#getTime()}</li> * <li>{@link com.jkoolcloud.tnt4j.core.UsecTimestamp} value is serialized as number using * {@link com.jkoolcloud.tnt4j.core.UsecTimestamp#getTimeUsec()}</li> * <li>all other cases are serialized using {@link Utils#toString(Object)}</li> * </ul> * * @param propValue * property value to convert * @return string representation of property value * * @see java.util.Date#getTime() * @see com.jkoolcloud.tnt4j.core.UsecTimestamp#getTimeUsec() * @see com.jkoolcloud.tnt4j.utils.Utils#toString(Object) */ protected static String propValueToString(Object propValue) { if (propValue instanceof Date) { return Long.toString(((Date) propValue).getTime()); } else if (propValue instanceof UsecTimestamp) { return Long.toString(((UsecTimestamp) propValue).getTimeUsec()); } else { return Utils.toString(propValue); } }
jsonString.append(JSON_TIME_USEC_LABEL).append(ATTR_SEP).append(snap.getTimeStamp().getTimeUsec()).append(ATTR_JSON); jsonString.append(JSON_TTL_SEC_LABEL).append(ATTR_SEP).append(snap.getTTL()).append(ATTR_JSON);
jsonString.append(JSON_START_TIME_USEC_LABEL).append(ATTR_SEP).append(activity.getStartTime().getTimeUsec()) .append(ATTR_JSON); jsonString.append(JSON_END_TIME_USEC_LABEL).append(ATTR_SEP).append(activity.getEndTime().getTimeUsec()) .append(ATTR_JSON); jsonString.append(JSON_ELAPSED_TIME_USEC_LABEL).append(ATTR_SEP).append(activity.getElapsedTimeUsec())
if (event.getOperation().getStartTime() != null) { jsonString.append(JSON_START_TIME_USEC_LABEL).append(ATTR_SEP) .append(event.getOperation().getStartTime().getTimeUsec()).append(ATTR_JSON); .append(event.getOperation().getEndTime().getTimeUsec()).append(ATTR_JSON); jsonString.append(JSON_ELAPSED_TIME_USEC_LABEL).append(ATTR_SEP) .append(event.getOperation().getElapsedTimeUsec()).append(ATTR_JSON);
activity.start(tev.getOperation().getStartTime().getTimeUsec()); activity.setResource(frame.getClassName()); activity.setStatus(ex != null ? ActivityStatus.EXCEPTION : ActivityStatus.END); activity.tnt(tev); activity.stop(tev.getOperation().getEndTime().getTimeUsec(), 0); logger.tnt(activity); lastSnapshot = lastReport;