Tabnine Logo
StopWatch.stopAndGetMillis
Code IndexAdd Tabnine to your IDE (free)

How to use
stopAndGetMillis
method
in
com.helger.commons.timing.StopWatch

Best Java code snippets using com.helger.commons.timing.StopWatch.stopAndGetMillis (Showing top 20 results out of 315)

origin: com.helger/ph-xservlet

 public void afterRequest (@Nonnull final IRequestWebScope aRequestScope)
 {
  // Timer per HTTP method
  m_aTimer.addTime (aRequestScope.getHttpMethod ().getName (), m_aSW.stopAndGetMillis ());
 }
}
origin: com.helger/peppol-directory-indexer

private static <T> T _timedSearch (@Nonnull final IThrowingSupplier <T, IOException> aRunnable,
                  @Nonnull final Query aQuery) throws IOException
{
 final StopWatch aSW = StopWatch.createdStarted ();
 try
 {
  return aRunnable.get ();
 }
 finally
 {
  final long nMillis = aSW.stopAndGetMillis ();
  s_aStatsQueryTimer.addTime (aQuery.toString (), nMillis);
  if (nMillis > CGlobal.MILLISECONDS_PER_SECOND)
   LOGGER.warn ("Lucene Query " + aQuery + " took too long: " + nMillis + "ms");
 }
}
origin: com.helger/ph-webscopes

@Override
protected final void doPost (@Nonnull final HttpServletRequest aHttpRequest,
               @Nonnull final HttpServletResponse aHttpResponse) throws ServletException, IOException
{
 final RequestScopeInitializer aRequestScopeInitializer = beforeRequest (aHttpRequest, aHttpResponse);
 final StopWatch aSW = new StopWatch (true);
 try
 {
  onPost (aHttpRequest, aHttpResponse, aRequestScopeInitializer.getRequestScope ());
 }
 finally
 {
  s_aTimerHdlPost.addTime (aSW.stopAndGetMillis ());
  aRequestScopeInitializer.destroyScope ();
 }
}
origin: com.helger/ph-webscopes

@Override
protected final void doPut (@Nonnull final HttpServletRequest aHttpRequest,
              @Nonnull final HttpServletResponse aHttpResponse) throws ServletException, IOException
{
 final RequestScopeInitializer aRequestScopeInitializer = beforeRequest (aHttpRequest, aHttpResponse);
 final StopWatch aSW = new StopWatch (true);
 try
 {
  onPut (aHttpRequest, aHttpResponse, aRequestScopeInitializer.getRequestScope ());
 }
 finally
 {
  s_aTimerHdlPut.addTime (aSW.stopAndGetMillis ());
  aRequestScopeInitializer.destroyScope ();
 }
}
origin: com.helger/ph-webscopes

@Override
protected final void doHead (@Nonnull final HttpServletRequest aHttpRequest,
               @Nonnull final HttpServletResponse aHttpResponse) throws ServletException, IOException
{
 final RequestScopeInitializer aRequestScopeInitializer = beforeRequest (aHttpRequest, aHttpResponse);
 final StopWatch aSW = new StopWatch (true);
 try
 {
  onHead (aHttpRequest, aHttpResponse, aRequestScopeInitializer.getRequestScope ());
 }
 finally
 {
  s_aTimerHdlHead.addTime (aSW.stopAndGetMillis ());
  aRequestScopeInitializer.destroyScope ();
 }
}
origin: com.helger/ph-webscopes

@Override
protected final void doGet (@Nonnull final HttpServletRequest aHttpRequest,
              @Nonnull final HttpServletResponse aHttpResponse) throws ServletException, IOException
{
 final RequestScopeInitializer aRequestScopeInitializer = beforeRequest (aHttpRequest, aHttpResponse);
 final StopWatch aSW = new StopWatch (true);
 try
 {
  onGet (aHttpRequest, aHttpResponse, aRequestScopeInitializer.getRequestScope ());
 }
 finally
 {
  s_aTimerHdlGet.addTime (aSW.stopAndGetMillis ());
  aRequestScopeInitializer.destroyScope ();
 }
}
origin: com.helger/ph-webscopes

 @Override
 protected final void doTrace (@Nonnull final HttpServletRequest aHttpRequest,
                @Nonnull final HttpServletResponse aHttpResponse) throws ServletException, IOException
 {
  final RequestScopeInitializer aRequestScopeInitializer = beforeRequest (aHttpRequest, aHttpResponse);
  final StopWatch aSW = new StopWatch (true);
  try
  {
   onTrace (aHttpRequest, aHttpResponse, aRequestScopeInitializer.getRequestScope ());
  }
  finally
  {
   s_aTimerHdlTrace.addTime (aSW.stopAndGetMillis ());
   aRequestScopeInitializer.destroyScope ();
  }
 }
}
origin: com.helger/ph-webscopes

@Override
protected final void doDelete (@Nonnull final HttpServletRequest aHttpRequest,
                @Nonnull final HttpServletResponse aHttpResponse) throws ServletException, IOException
{
 final RequestScopeInitializer aRequestScopeInitializer = beforeRequest (aHttpRequest, aHttpResponse);
 final StopWatch aSW = new StopWatch (true);
 try
 {
  onDelete (aHttpRequest, aHttpResponse, aRequestScopeInitializer.getRequestScope ());
 }
 finally
 {
  s_aTimerHdlDelete.addTime (aSW.stopAndGetMillis ());
  aRequestScopeInitializer.destroyScope ();
 }
}
origin: com.helger/ph-webscopes

@Override
protected final void doOptions (@Nonnull final HttpServletRequest aHttpRequest,
                @Nonnull final HttpServletResponse aHttpResponse) throws ServletException,
                                         IOException
{
 final RequestScopeInitializer aRequestScopeInitializer = beforeRequest (aHttpRequest, aHttpResponse);
 final StopWatch aSW = new StopWatch (true);
 try
 {
  onOptions (aHttpRequest, aHttpResponse, aRequestScopeInitializer.getRequestScope ());
 }
 finally
 {
  s_aTimerHdlOptions.addTime (aSW.stopAndGetMillis ());
  aRequestScopeInitializer.destroyScope ();
 }
}
origin: com.helger/ph-oton-core

public final void contextDestroyed (@Nonnull final ServletContextEvent aSCE)
{
 final ServletContext aSC = aSCE.getServletContext ();
 final StopWatch aSW = StopWatch.createdStarted ();
 if (LOGGER.isInfoEnabled ())
  LOGGER.info ("Servlet context '" + aSC.getServletContextName () + "' is being destroyed");
 // Callback before global scope end
 beforeContextDestroyed (aSC);
 // Shutdown global scope and destroy all singletons
 WebScopeManager.onGlobalEnd ();
 // Callback after global scope end
 afterContextDestroyed (aSC);
 // Handle statistics
 if (isHandleStatisticsOnEnd ())
  handleStatisticsOnEnd ();
 // Clean commons stuff etc
 PhotonBasic.shutdown ();
 if (isOnlyOneInstanceAllowed ())
 {
  // De-init
  s_aInited.set (false);
 }
 if (LOGGER.isInfoEnabled ())
  LOGGER.info ("Servlet context '" +
         aSC.getServletContextName () +
         "' was destroyed in " +
         aSW.stopAndGetMillis () +
         " milli seconds");
}
origin: com.helger/ph-xml

final long nMillis = aSW.stopAndGetMillis ();
if (nMillis > 1000)
 if (LOGGER.isWarnEnabled ())
origin: com.helger/ph-db-jpa

 aTransaction.commit ();
s_aStatsCounterSuccess.increment ();
s_aStatsTimerExecutionSuccess.addTime (aSW.stopAndGetMillis ());
return JPAExecutionResult.createSuccess (ret);
s_aStatsTimerExecutionError.addTime (aSW.stopAndGetMillis ());
_invokeCustomExceptionCallback (ex);
return JPAExecutionResult.createFailure (ex);
origin: com.helger/ph-db-jpa

s_aStatsTimerExecutionSuccess.addTime (aSW.stopAndGetMillis ());
return JPAExecutionResult.createSuccess (ret);
s_aStatsTimerExecutionError.addTime (aSW.stopAndGetMillis ());
_invokeCustomExceptionCallback (ex);
return JPAExecutionResult.<T> createFailure (ex);
origin: com.helger/ph-xml

 s_aDomTimerHdl.addTime (aSW.stopAndGetMillis ());
else
 s_aDomSchemaTimerHdl.addTime (aSW.stopAndGetMillis ());
origin: com.helger/ph-dao

 throw new DAOException ("Failed to write DAO XML data to file");
m_aStatsCounterWriteTimer.addTime (aSW.stopAndGetMillis ());
m_aStatsCounterWriteSuccess.increment ();
m_nWriteCount++;
origin: com.helger/ph-dao

m_aStatsCounterWriteTimer.addTime (aSW.stopAndGetMillis ());
m_aStatsCounterWriteSuccess.increment ();
m_nWriteCount++;
origin: com.helger/ph-oton-core

final long nExecutionMillis = aSW.stopAndGetMillis ();
s_aStatsFunctionTimer.addTime (sPath, nExecutionMillis);
final long nLimitMS = APISettings.getLongRunningExecutionLimitTime ();
origin: com.helger/ph-oton-core

final long nExecutionMillis = aSW.stopAndGetMillis ();
s_aStatsFunctionTimer.addTime (sFunctionName, nExecutionMillis);
final long nLimitMS = AjaxSettings.getLongRunningExecutionLimitTime ();
origin: com.helger/ph-oton-core

.addTime (aSW.stopAndGetMillis ());
origin: com.helger/ph-oton-core

aSC.getServletContextName () +
"' was initialized in " +
aSW.stopAndGetMillis () +
" milli seconds");
com.helger.commons.timingStopWatchstopAndGetMillis

Popular methods of StopWatch

  • createdStarted
  • getMillis
  • <init>
  • stop
  • stopAndGetDuration

Popular in Java

  • Making http requests using okhttp
  • setContentView (Activity)
  • onRequestPermissionsResult (Fragment)
  • compareTo (BigDecimal)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • BoxLayout (javax.swing)
  • JPanel (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now