How to show page creation statistics in Grails

Besides adding a custom timer to measure the start and end of the controller, is there a simpler or more useful way to show how long the page actually loads (i.e. show at the bottom of the page: this page was generated in 30.5 seconds)? Please note that Grails has a taglib concept in which you can add additional logic after all the processing done in the controller.

I'm actually still not sure how the controller and taglib work, or how the whole page is displayed in Grails, maybe they are being processed in parallel? Feel free to educate me about this as well.

Thanks!

+4
source share
4 answers

If you just need the time spent on the action and to render your gsp (with all its tags), you can use a simple filter to measure it. Take a look at this blog post: Profiling Web requests in the Grails app (disclaimer: I'm the author)

Regards, Deluan

+3
source

There are several ways to get time.

  • The easiest way is to configure the server to record logs with page generation time.
  • you can enter a time, for example, a security filter and the end of your page, but, as you already mentioned, even that would mean reinventing the wheel.
  • Have you checked the plugins?

but if you want to present the time to your users, I would suggest downloading the debug plugin, unzipping it and checking where the time is measured. You can easily copy this code and use it to display the time on the page.

+2
source

I used Spring Insight using STS. This is absolutely awesome for the Grails app in development. Changing tomcat for use in poroduction makes it a little complicated though

But you can go down to the duration of each choice from sleep mode, and you have a real-time metric through the entire application stack

+2
source

Not quite what you requested (sorry), but maybe the JavaMelody plugin for Grails is interesting:

The goal of JavaMelody is to monitor Java or Java EE Application Servers in QA and production environments. it is not a tool for modeling requests from users, it is a tool for measuring and calculating statistics on the actual operation of the application depending on the use of the application by users.

Didn't try it myself, but it looks useful

+1
source

All Articles