Using Spring StopWatch to measure performance of your server code

import org.springframework.util.StopWatch;
//Very 1st statement in controller method :

StopWatch stopwatch = new Stopwatch(“some name here”);
stopwatch.start(“snippet 1″);

//code snippet 1 here

stopwatch.stop();

stopwatch.start(“snippet 2″);

//code snippet 2 here

stopwatch.stop();


logger.debug(stopwatch.prettyPrint());

 

Leave a Reply