Implement AOP with groovy to performance profile a Grails app (dynamic weaving, as in AspectJ)
I need to collect performance metrics for a bunch of Grails on G开发者_运维技巧roovy apps. I'm thinking of doing it on the basis of a few examples on the web (cf. http://www.infoq.com/articles/aop-with-groovy). I think I've got what I need to do in terms of collecting perf data across method and closure boundaries.
What I have not a good idea of doing is o how can I bunch up my perf stats together so that their granularity is preserved o how to be able to weave the advice at load time using Groovy/Grails instead of instrumenting the code before run-time
Any (and every) help is very welcome!
Thanks
first of all: don't do this yourself. especially in Groovy it's not easy to get monitoring done right due to byte code manipulation/optimization by groovyc, possible mess up with AST transformations etc.
take a look at Spring Insight. It comes with the developer edition of tc-server and lets you monitor everything down to GORM-generated SQL statements.
another thing I'v googled is the perf4j Grails plugin, from the documentation it looks pretty what you might need.
精彩评论