Package org.springframework.util

Examples of org.springframework.util.StopWatch.stop()


               "Profiling for '" + arg0.getClass().getName() + "' and '" + arg0.getArguments() + "'");
         try {
            clock.start(arg0.getMethod().getName());
            return arg0.proceed();
         } finally {
            clock.stop();
            LOG.info(clock.prettyPrint());
         }   
  }

}
View Full Code Here


      returnValue = invocation.proceed();
      return returnValue;
    }
    catch (Throwable ex) {
      if(stopWatch.isRunning()) {
        stopWatch.stop();
      }
      exitThroughException = true;
      writeToLog(logger,
          replacePlaceholders(this.exceptionMessage, invocation, null, ex, stopWatch.getTotalTimeMillis()), ex);
      throw ex;
View Full Code Here

      throw ex;
    }
    finally {
      if (!exitThroughException) {
        if(stopWatch.isRunning()) {
          stopWatch.stop();
        }
        writeToLog(logger,
            replacePlaceholders(this.exitMessage, invocation, returnValue, null, stopWatch.getTotalTimeMillis()));
      }
    }
View Full Code Here

    StopWatch sw = new StopWatch();
    sw.start();
    for (int i = 0; i < 1000000; i++) {
      ServletRequestUtils.getIntParameter(request, "nonExistingParam", 0);
    }
    sw.stop();
    System.out.println(sw.getTotalTimeMillis());
    assertTrue("getStringParameter took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 250);
  }

  public void testGetLongParameterWithDefaultValueHandlingIsFastEnough() {
View Full Code Here

    StopWatch sw = new StopWatch();
    sw.start();
    for (int i = 0; i < 1000000; i++) {
      ServletRequestUtils.getLongParameter(request, "nonExistingParam", 0);
    }
    sw.stop();
    System.out.println(sw.getTotalTimeMillis());
    assertTrue("getStringParameter took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 250);
  }

  public void testGetFloatParameterWithDefaultValueHandlingIsFastEnough() {
View Full Code Here

    StopWatch sw = new StopWatch();
    sw.start();
    for (int i = 0; i < 1000000; i++) {
      ServletRequestUtils.getFloatParameter(request, "nonExistingParam", 0f);
    }
    sw.stop();
    System.out.println(sw.getTotalTimeMillis());
    assertTrue("getStringParameter took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 250);
  }

  public void testGetDoubleParameterWithDefaultValueHandlingIsFastEnough() {
View Full Code Here

    StopWatch sw = new StopWatch();
    sw.start();
    for (int i = 0; i < 1000000; i++) {
      ServletRequestUtils.getDoubleParameter(request, "nonExistingParam", 0d);
    }
    sw.stop();
    System.out.println(sw.getTotalTimeMillis());
    assertTrue("getStringParameter took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 250);
  }

  public void testGetBooleanParameterWithDefaultValueHandlingIsFastEnough() {
View Full Code Here

    StopWatch sw = new StopWatch();
    sw.start();
    for (int i = 0; i < 1000000; i++) {
      ServletRequestUtils.getBooleanParameter(request, "nonExistingParam", false);
    }
    sw.stop();
    System.out.println(sw.getTotalTimeMillis());
    assertTrue("getStringParameter took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 250);
  }

  public void testGetStringParameterWithDefaultValueHandlingIsFastEnough() {
View Full Code Here

    StopWatch sw = new StopWatch();
    sw.start();
    for (int i = 0; i < 1000000; i++) {
      ServletRequestUtils.getStringParameter(request, "nonExistingParam", "defaultValue");
    }
    sw.stop();
    System.out.println(sw.getTotalTimeMillis());
    assertTrue("getStringParameter took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 250);
  }

}
View Full Code Here

    StopWatch sw = new StopWatch();
    sw.start();
    for (int i = 0; i < 1000000; i++) {
      PortletRequestUtils.getBooleanParameter(request, "nonExistingParam", false);
    }
    sw.stop();
    System.out.println(sw.getTotalTimeMillis());
    assertTrue("getStringParameter took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 250);
  }

  public void testGetStringParameterWithDefaultValueHandlingIsFastEnough() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.