Archive for the ‘Framework’ Category

Using Spring StopWatch to measure performance of your server code

Tuesday, October 14th, 2014

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