Permalink
Browse files

Update plugin metadata and docs.

  • Loading branch information...
1 parent 76b0cee commit 90ec27696e0b2cc882ff7b2ec29b6444e457f235 @pledbrook committed Sep 26, 2012
Showing with 71 additions and 33 deletions.
  1. +2 −0 .gitignore
  2. +7 −5 ProfilerGrailsPlugin.groovy
  3. +58 −0 README
  4. +4 −2 application.properties
  5. +0 −26 plugin.xml
View
@@ -1,2 +1,4 @@
+grails-profiler-*.zip*
docs/
+target/
web-app/
@@ -12,19 +12,21 @@ import org.springframework.aop.framework.ProxyFactoryBean
import org.springframework.transaction.interceptor.TransactionProxyFactoryBean
class ProfilerGrailsPlugin {
- def version = "0.4"
+ def version = "0.4.1"
def grailsVersion = "1.3.3 > *"
- def loadAfter = ["services"]
+ def loadAfter = ["services", "controllers"]
def title = "Profile Plugin"
def author = "Peter Ledbrook"
- def authorEmail = "peter@g2one.com"
- def description = "Profile applications on a per-request basis, logging how long requests, controller actions, service method calls, and others take."
+ def authorEmail = "p.ledbrook@cacoethes.co.uk"
+ def description = """\
+Profile applications on a per-request basis, logging how \
+long requests, controller actions and service method calls take."""
def documentation = "http://grails.org/plugin/profiler"
def license = 'APACHE'
def developers = [[name: "Burt Beckwith", email: "beckwithb@vmware.com"]]
def issueManagement = [system: 'JIRA', url: 'http://jira.grails.org/browse/GPPROFILER']
- def scm = [url: 'http://svn.codehaus.org/grails-plugins/grails-profiler']
+ def scm = [url: 'https://github.com/pledbrook/grails-profiler']
def getWebXmlFilterOrder() {
def FilterManager = getClass().getClassLoader().loadClass('grails.plugin.webxml.FilterManager')
View
58 README
@@ -35,3 +35,61 @@ It is also possible to place the profiling information in your HTML pages by usi
This will simply write out the profiling information collected so far for the current request. For best results it should be included in the layout inside an HTML comment. If you use it directly within a view, the profiling information will lack the timing for the view generation itself.
For more information, go to the [plugin portal page](http://grails.org/plugin/profiler).
+
+### Disabling the profiler
+
+You can set a configuration option to completely disable the plugin:
+
+ grails.profiler.disable = true
+
+This is particularly useful on a per-environment basis, in case you don't want the impact of profiling in production or even development.
+
+## Advanced usage
+
+The plugin is designed around a set of Spring beans that can be used directly from within your code if you require. The most useful beans are documented here with their bean names.
+
+### profilerCondition
+
+This bean implements the `com.linkedin.grails.profiler.ProfilerCondition` interface and determines whether profiling is active for the current request or not. The default implementation checks the "profiler" parameter, but you can provide your own implementation in resource.groovy for example.
+
+<table>
+ <tr><th>*Method*</th><th>*Description*</th></tr>
+ <tr><td>*doProfiling()*</td><td>Returns `true` if profiling should be enabled for the current request, otherwise `false`.</td></tr>
+</table>
+
+### profilerLog
+
+This is the main bean. It sends log messages to all registered appenders while profiling is active. Otherwise it does nothing.
+
+<table>
+ <tr><th>*Method*</th><th>*Description*</th></tr>
+ <tr>
+ <td>*startProfiling(String)*</td>
+ <td>Starts the profiler and assigns the given label to the log messages.
+ <tr>
+ <td>*stopProfiling()*</td>
+ <td>Stops the profiler.</td>
+ </tr>
+ <tr>
+ <td>*isProfiling()*</td>
+ <td>Returns `true` if the profiler is currently active, otherwise `false`.</td>
+ </tr>
+ <tr>
+ <td>*logEntry(Class, String)*</td>
+ <td>Logs entry to an action/method/whatever.</td>
+ </tr>
+ <tr>
+ <td>*logExit(Class, String)*</td>
+ <td>Logs exit from an action/method/whatever. There should be one call to `logExit()` for every `logEntry()`.</td>
+ </tr>
+</table>
+
+### bufferedAppender
+
+A special appender that stores its log messages in a buffer so that it can be retrieved from code. Inject the bean into your own and get the output whenever you like!
+
+<table>
+ <tr><th>*Method*</th><th>*Description*</th></tr>
+ <tr><td>*getOutput()*</td><td>Returns the log output currently stored in this appender's buffer.</td></tr>
+</table>
+
View
@@ -1,2 +1,4 @@
-app.grails.version=2.0.0
-plugins.release=1.0.1
+#Grails Metadata file
+#Wed Sep 26 16:26:53 BST 2012
+app.grails.version=2.0.4
+plugins.release=2.0.4
View
@@ -1,26 +0,0 @@
-<plugin name='profiler' version='0.4' grailsVersion='1.3.3 &gt; *'>
- <author>Peter Ledbrook</author>
- <authorEmail>peter@g2one.com</authorEmail>
- <title>Profile Plugin</title>
- <description>Profile applications on a per-request basis, logging how long requests, controller actions, service method calls, and others take.</description>
- <documentation>http://grails.org/plugin/profiler</documentation>
- <type>ProfilerGrailsPlugin</type>
- <resources>
- <resource>ProfilerTagLib</resource>
- </resources>
- <repositories>
- <repository name='grailsCentral' url='http://plugins.grails.org' />
- <repository name='http://repo.grails.org/grails/plugins' url='http://repo.grails.org/grails/plugins/' />
- <repository name='http://repo.grails.org/grails/core' url='http://repo.grails.org/grails/core/' />
- <repository name='grailsCore' url='http://svn.codehaus.org/grails/trunk/grails-plugins' />
- <repository name='mavenCentral' url='http://repo1.maven.org/maven2/' />
- </repositories>
- <dependencies />
- <plugins>
- <compile>
- <plugin group='org.grails.plugins' name='webxml' version='1.4.1' />
- </compile>
- </plugins>
- <runtimePluginRequirements />
- <behavior />
-</plugin>

0 comments on commit 90ec276

Please sign in to comment.