protected void addMessage(final AppendingStringBuffer sb) { final long timeTaken = System.currentTimeMillis() - RequestCycle.get().getStartTime(); sb.append("Host: ") .append(host) .append(", handled in: ") .append(Duration.milliseconds(timeTaken)); }
/** * Convenience method that copies the input stream returned by {@link #getInputStream()} into a * temporary file. * <p> * Only use this if you actually need a {@link File} to work with, in all other cases use * {@link #getInputStream()} or {@link #getBytes()} * * @since 1.2 * * @return temporary file containing the contents of the uploaded file * @throws Exception */ public final File writeToTempFile() throws Exception { String sessionId = Session.exists() ? Session.get().getId() : ""; String tempFileName = sessionId + "_" + RequestCycle.get().getStartTime(); File temp = File.createTempFile(tempFileName, Files.cleanupFilename(item.getFieldName())); writeTo(temp); return temp; } }
/** * Convenience method that copies the input stream returned by {@link #getInputStream()} into a * temporary file. * <p> * Only use this if you actually need a {@link File} to work with, in all other cases use * {@link #getInputStream()} or {@link #getBytes()} * * @since 1.2 * * @return temporary file containing the contents of the uploaded file * @throws Exception */ public final File writeToTempFile() throws Exception { String sessionId = Session.exists() ? Session.get().getId() : ""; String tempFileName = sessionId + "_" + RequestCycle.get().getStartTime(); File temp = File.createTempFile(tempFileName, Files.cleanupFilename(item.getFieldName())); writeTo(temp); return temp; } }
@Override public void onDetach(final RequestCycle requestCycle) { if (Session.exists()) { Session.get().getPageManager().commitRequest(); } if (Application.exists()) { IRequestLogger requestLogger = Application.get().getRequestLogger(); if (requestLogger != null) { requestLogger.requestTime((System.currentTimeMillis() - requestCycle.getStartTime())); } } } });
@Override public void onDetach(final RequestCycle requestCycle) { if (Session.exists()) { Session.get().getPageManager().commitRequest(); } if (Application.exists()) { IRequestLogger requestLogger = Application.get().getRequestLogger(); if (requestLogger != null) { requestLogger.requestTime((System.currentTimeMillis() - requestCycle.getStartTime())); } } } });
long timeTaken = System.currentTimeMillis() - RequestCycle.get().getStartTime(); if (headIndex != -1 && bodyIndex != -1)
long timeTaken = System.currentTimeMillis() - RequestCycle.get().getStartTime(); if (headIndex != -1 && bodyIndex != -1)
int ajaxStart = responseBuffer.indexOf("<ajax-response>"); int ajaxEnd = responseBuffer.indexOf("</ajax-response>"); long timeTaken = System.currentTimeMillis() - RequestCycle.get().getStartTime(); if (headIndex != -1 && bodyIndex != -1)
int ajaxStart = responseBuffer.indexOf("<ajax-response>"); int ajaxEnd = responseBuffer.indexOf("</ajax-response>"); long timeTaken = System.currentTimeMillis() - RequestCycle.get().getStartTime(); if (headIndex != -1 && bodyIndex != -1)