A new plugin for Grails is in the oven and is still baking. However, the first rumours got out of the bakery. 🙂

Perf4J is to System.currentTimeMillis() as log4j is to System.out.println().

Using Perf4J, you will be able to stop the time for a Grails code block, like this:

withStopwatch("myCriticalCodeBlock") {     // code to be profiled with tag "myCriticalCodeBlock" }

You can also log the time for a service method, automatically, choose one or more of these alternatives:

static profiled = true static profiled = ['testMethod1', 'testMethod3'] static profiled = {     testMethod1()     testMethod2(tag: "tm2")     testMethod3(message: "only message")     testMethod4(tag: "tm4", message: "this is testMethod4()") }

Got the taste of it? Read the full story about the upcoming plugin and enjoy!