Package org.springframework.util

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


  public static void main(String[] args) {

      log.info("GridNode Starting...");
      StopWatch sw = new StopWatch();
      sw.start();

   
      GridNode node = Grid.startLightGridNode();

      log.info("GridNode ID : " + node.getId());
View Full Code Here


     
      // Create Buddhabrot Job
      BuddhabrotJob buddhabrotJob = new BuddhabrotJob(WIDTH, HEIGHT);
     
      // Start Job Submission
      sw.start();
     
      System.err.println(new Date());
     
      GridJobFuture future = node.getJobSubmissionService()
          .submitJob(buddhabrotJob, new ResultCallback() {
View Full Code Here

        testPerf(factoryBean);
    }

    public static void testPerf(DemoBean bean) {
        StopWatch stopWatch = new StopWatch();
        stopWatch.start("perfTest");

        for (int x = 0; x < 1000000; x++) {
            MyHelper helper = bean.getMyHelper();
            helper.doSomethingHelpful();
        }
View Full Code Here

        System.out.println("Helper Instances the Same?: "
                + (helper1 == helper2));

        StopWatch stopWatch = new StopWatch();
        stopWatch.start("lookupDemo");

        for (int x = 0; x < 100000; x++) {
            MyHelper helper = bean.getMyHelper();
            helper.doSomethingHelpful();
        }
View Full Code Here

    private static void displayInfo(ReplacementTarget target) {
        System.out.println(target.formatMessage("Hello World!"));

        StopWatch stopWatch = new StopWatch();
        stopWatch.start("perfTest");

        for (int x = 0; x < 1000000; x++) {
            String out = target.formatMessage("foo");
        }
View Full Code Here

public class ProfilingInterceptor implements MethodInterceptor {

    public Object invoke(MethodInvocation invocation) throws Throwable {
        // start the stop watch
        StopWatch sw = new StopWatch();
        sw.start(invocation.getMethod().getName());

        Object returnValue = invocation.proceed();

        sw.stop();
        dumpInfo(invocation, sw.getTotalTimeMillis());
View Full Code Here

    String name = invocation.getMethod().getDeclaringClass().getName() + "." + invocation.getMethod().getName();
    StopWatch stopWatch = new StopWatch(name);
    Object returnValue = null;
    boolean exitThroughException = false;
    try {
      stopWatch.start(name);
      writeToLog(logger,
          replacePlaceholders(this.enterMessage, invocation, null, null, -1));
      returnValue = invocation.proceed();
      return returnValue;
    }
View Full Code Here


  protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throws Throwable {
    String name = createInvocationTraceName(invocation);
    StopWatch stopWatch = new StopWatch(name);
    stopWatch.start(name);
    try {
      return invocation.proceed();
    }
    finally {
      stopWatch.stop();
View Full Code Here

    PrimitiveArrayBean tb = new PrimitiveArrayBean();
    BeanWrapper bw = new BeanWrapperImpl(tb);
    int[] input = new int[1024];
    StopWatch sw = new StopWatch();
    sw.start("array1");
    for (int i = 0; i < 1000; i++) {
      bw.setPropertyValue("array", input);
    }
    sw.stop();
    assertEquals(1024, tb.getArray().length);
View Full Code Here

    assertEquals(0, tb.getArray()[0]);
    long time1 = sw.getLastTaskTimeMillis();
    assertTrue("Took too long", sw.getLastTaskTimeMillis() < 100);

    bw.registerCustomEditor(String.class, new StringTrimmerEditor(false));
    sw.start("array2");
    for (int i = 0; i < 1000; i++) {
      bw.setPropertyValue("array", input);
    }
    sw.stop();
    assertTrue("Took too long", sw.getLastTaskTimeMillis() < 100);
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.