Package org.springframework.util

Examples of org.springframework.util.StopWatch


            marshaller.marshal(jaxbElement, message.getPayloadResult());
        }
    }

    public static void main(String[] args) throws Exception {
        StopWatch stopWatch = new StopWatch();

        try {
            saaj(stopWatch);
            axiom(stopWatch, false, false);
            axiom(stopWatch, true, false);
            axiom(stopWatch, false, true);
            axiom(stopWatch, true, true);
            stroap(stopWatch, false, false);
            stroap(stopWatch, true, false);
            stroap(stopWatch, false, true);
            stroap(stopWatch, true, true);

        }
        finally {
            System.out.println(stopWatch.prettyPrint());
        }
    }
View Full Code Here


  public static void main(String[] args) {
    try {

      log.info("GridNode Starting...");
      StopWatch sw = new StopWatch();
      sw.start();
     
      GridNode node = Grid.startGridNode();
     
      log.info("GridNode ID : " + node.getId());
     
      sw.stop();

      log.info("GridNode Started Up. [" + sw.getLastTaskTimeMillis() + " ms]");
     
      // Submit Job
      log.debug("Reading NAR");
     
      sw.start();
     
      GridArchive archive;
      archive = GridArchive.fromFile(new File("simpletestjob.nar"));
     
      log.debug("Submitting NAR");
     
      GridJobFuture future = (GridJobFuture) node.getJobSubmissionService().submitArchive(archive).values().toArray()[0];
     
      try {
        log.info("RESULT : " + future.getResult());
      } catch (RemoteInvocationFailureException e) {
        e.getCause().printStackTrace();
      }
     
      sw.stop();
      log.info("GridJob Finished. Duration " + sw.getLastTaskTimeMillis() + " ms");
     
      log.debug("Press any key to unregister GridNode and terminate");
      System.in.read();
      node.getNodeRegistrationService().unregister();
     
View Full Code Here

    TestUnboundedJob testJob = new TestUnboundedJob();
   
    try {

      log.info("GridNode Starting...");
      StopWatch sw = new StopWatch();
      sw.start();
     
      GridNode node = Grid.startGridNode();
     
      log.info("GridNode ID : " + node.getId());
     
      sw.stop();

      log.info("GridNode Started Up. [" + sw.getLastTaskTimeMillis() + " ms]");
     
      // Submit Job
      log.debug("Submitting Job");
     
      sw.start();
     
      GridJobFuture future = node.getJobSubmissionService().submitJob(testJob,new ResultCallback() {

        public void onResult(Serializable result) {
          System.err.println(result);
        }
       
      });

      while(!future.isJobFinished()) {
        Thread.sleep(1000);
      }
     
      sw.stop();
      log.info("GridJob Finished. Duration " + sw.getLastTaskTimeMillis() + " ms");
     
      log.debug("Press any key to unregister GridNode and terminate");
      System.in.read();
      node.getNodeRegistrationService().unregister();
     
View Full Code Here

    // Create App Instance
    SequentialMandelbrotApp app = new SequentialMandelbrotApp();

    app.requestFocus();

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

    // Start Rendering
    app.startRendering();
   
    sw.stop();
   
    log.info("Computation Complete... " + sw.getLastTaskTimeMillis() + "ms");
    //System.exit(0);

  }
View Full Code Here

    TestJob testJob = new TestJob();
   
    try {

      log.info("GridNode Starting...");
      StopWatch sw = new StopWatch();
      sw.start();
     
      GridNode node =  Grid.startGridNode();
     
      log.info("GridNode ID : " + node.getId());
     
      sw.stop();

      log.info("GridNode Started Up. [" + sw.getLastTaskTimeMillis() + " ms]");
     
      // Submit Job
      log.debug("Submitting Job");
     
      sw.start();
     
      GridJobFuture future = node.getJobSubmissionService().submitJob(testJob,new ResultCallback() {

        public void onResult(Serializable result) {
          System.err.println(result);
        }
       
      });
      try {
        log.info("Job Result : " + future.getResult());
      } catch (RemoteInvocationFailureException e) {
        e.getCause().printStackTrace();
      }
     
      sw.stop();
      log.info("GridJob Finished. Duration " + sw.getLastTaskTimeMillis() + " ms");
     
      log.debug("Press any key to unregister GridNode and terminate");
      System.in.read();
      node.getNodeRegistrationService().unregister();
     
View Full Code Here

  public static void main(String[] args) {

    try {

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

      GridNode node = Grid.startLightGridNode();

      log.info("GridNode ID : " + node.getId());

      sw.stop();

      log.info("GridNode Started Up. [" + sw.getLastTaskTimeMillis()
          + " ms]");

      // Create App Instance
      final MandelbrotApp app = new MandelbrotApp(node);

      app.requestFocus();
     
      // Create Mandelbrot Job
      MandelbrotJob mandelbrotJob = new MandelbrotJob(app.getWidth(), app
          .getHeight());
     
      // Start Job Submission
      sw.start();
     
      GridJobFuture future = node.getJobSubmissionService()
          .submitJob(mandelbrotJob, new ResultCallback() {

            public void onResult(Serializable result) {
             
              MandelbrotResult mResult = (MandelbrotResult) result;
              app.displayResult(mResult);
              app.setProgress(app.getProgress()
                  + mResult.getLines());
            }

          });
     
      app.setFuture(future);
      // Block till job finishes
      future.getResult();
      app.setDone(true);
     
      sw.stop();
     
      log.info("GridJob Finished. Duration " + sw.getLastTaskTimeMillis()
          + " ms");

      log.debug("Press any key to unregister GridNode and terminate");
      System.in.read();
      node.getNodeRegistrationService().unregister();
View Full Code Here

  public static void main(String[] args) {

    try {

      log.info("GridNode Starting...");
      StopWatch sw = new StopWatch();
      sw.start();
     
      // Start Grid Node
      GridNode node = Grid.startGridNode();
     
      sw.stop();
      log.info("GridNode Started Up. [" + sw.getLastTaskTimeMillis() + " ms]");
     
      log.info("GridNode ID : " + node.getId());
     
      log.debug("Press any key to unregister GridNode and terminate");
      System.in.read();
View Full Code Here

  }

  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());

      log.info("Registered in Cluster : "
          + node.getNodeRegistrationService().getRegistration()
              .getClusterId());

      sw.stop();

      log.info("GridNode Started Up. [" + sw.getLastTaskTimeMillis()
          + " ms]");

      // Create App Instance
      final BuddhabrotApp app = new BuddhabrotApp(node);

      app.requestFocus();
     
      // 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(abstractBean);
        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();
        }

        stopWatch.stop();

        System.out.println("1000000 gets took "
                + stopWatch.getTotalTimeSeconds() + " seconds");
    }
View Full Code Here

        MyHelper helper2 = bean.getMyHelper();

        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();
        }

        stopWatch.stop();

        System.out.println("100000 gets took " + stopWatch.getTotalTimeMillis()
                + " ms");

    }
View Full Code Here

TOP

Related Classes of org.springframework.util.StopWatch

Copyright © 2018 www.massapicom. 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.