tomdcc / grails-miniprofiler

Miniprofiler plugin for Grails
Other
16 stars 4 forks source link

Grails Miniprofiler plugin

Build Status

This plugin provides the functionality of the StackExchange .NET MiniProfiler for Grails applications.

It uses the functionality of the Grails Profiler plugin along with SQL intrumentation using log4jdbc to shows timing information and sql query information in a heads-up display in a web page, useful for debugging database and other performance problems.

Installation

This plugin also requires the Profiler Plugin to be installed:

plugins {
    // etc
    runtime ':profiler:0.4.1'
    runtime ':miniprofiler:0.1'
}

NOTE: at time of writing the currently released profiler plugin (0.4) has bugs with Grails 2.2+. Until an updated version is released, you'll need to grab it from source at GitHub and either install it locally using grails package-plugin in the grails-profiler directory, followed by grails install-plugin /path/to/grails-profiler/grails-profiler-0.4.1.zip in your grails application directory, or deploy it to a local maven repo if you have one of those.

You should then add the following to the bottom of any layouts that you would like to see the profiling information on, just inside the bottom of the html body:

    <!-- rest of layout above -->
    <miniprofiler:javascript/>
    </body>
</html

Usage

This plugin adds a clickable overlay onto your website as per the Stack Exchange MiniProfiler. Your controller methods, views and service methods are all visible, and any SQL queries executed during each of those calls can be seen. See the talk from the Groovy & Grails Exchange 2012 which introduced the plugin here.

Known Issues

This is very early code, all bug reports and suggestions very welcome!

Changelog

0.3

0.2

0.1