18. Mai 2012

Perf4J plugin for Grails logs the time

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!

Diese Beiträge könnten Sie noch interessieren:

Kommentare

  1. Daniel Rinser meint:

    Hi Matthias,

    thanks a lot for featuring my plugin! I’ve just applied some finishing touches and I’m now looking for some people to test the pre-release to get some feedback. So, in case you (or somebody else) is interested, drop me a line (mail/grails-user mailing list). Feedback on the documentation is also very welcome.

    Cheers,
    Daniel

Ihre Meinung ist uns wichtig

*