/** * Gets the time the operation started. * * @return operation start time */ public UsecTimestamp getStartTime() { return new UsecTimestamp(startTimeUs); }
/** * 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(); }
/** * Gets the time the operation ended. * * @return operation end time */ public UsecTimestamp getEndTime() { return new UsecTimestamp(endTimeUs); }
public static void debug(UsecTimestamp simTime, String msg) { if (isDebugEnabled()) { if (simTime == null) { simTime = new UsecTimestamp(); } logger.tnt(OpLevel.DEBUG, null, null, "SimTime=" + simTime + ": " + msg); } }
public static void trace(UsecTimestamp simTime, String msg) { if (isTraceEnabled()) { if (simTime == null) { simTime = new UsecTimestamp(); } logger.tnt(OpLevel.TRACE, null, null, "SimTime=" + simTime + ": " + msg); } }
public static JKCloudConnection connect() throws IOException { if (StringUtils.isEmpty(jkHost)) { return null; } if (gwConn != null) { return gwConn; } String gwUrl = TNT4JSimulator.getConnectUrl(); TNT4JSimulator.debug(new UsecTimestamp(), "Connecting to service=" + gwUrl + " with access token=" + jkAccessToken + (jKConnTimeout == null ? "" : " and connection timeout=" + jKConnTimeout) + " ..."); gwConn = new JKCloudConnection(gwUrl, jkAccessToken, jKConnTimeout, logger); gwConn.open(); return gwConn; }
try { long tstamp = Long.parseLong(value); propValue = new UsecTimestamp((vary ? TNT4JSimulator.varyValue(tstamp) : tstamp)); } catch (NumberFormatException e) { propValue = new UsecTimestamp(value, "yyyy-MM-dd HH:mm:ss.SSSSSS", (String) null);
/** * {@inheritDoc} */ @Override public void startDocument() throws SAXException { activeActivities.clear(); activeElements.clear(); genValues.clear(); curMsg = null; curActivity = null; curActivityStart = null; curElement = null; setDocumentLocator(saxLocator); if (TNT4JSimulator.useUniqueTags()) { tagSuffix = "@" + String.valueOf(Utils.currentTimeUsec()) + "@" + TNT4JSimulator.getIteration(); } if (TNT4JSimulator.useUniqueIds()) { for (Message m : messageIds.values()) { m.setTrackingId(TNT4JSimulator.newUUID()); } } if (TNT4JSimulator.useUniqueCorrs()) { corSuffix = "@" + String.valueOf(Utils.currentTimeUsec()) + "@" + TNT4JSimulator.getIteration(); } simCurrTime = new UsecTimestamp(); }
simCurrTime = new UsecTimestamp(); curActivityStart = new UsecTimestamp(simCurrTime);
simCurrTime = new UsecTimestamp();