« Back

Displaying portlet monitoring information

Company Blogs February 11, 2013 By Olaf Kock Staff

Exposing well hidden features

Those of you who attended my "Well Hidden Features of Liferay" presentation at the 2012 european symposium might remember the well hidden monitoring information that LIferay is able to hide at the bottom of each page, in HTML comments (when configured properly). (You can also listen to the recording of this presentation on Radio Liferay) The slide that I used in the presentation was probably the one with the most text I ever used on any slide (the background is a beautified version of what you find on a page, the foreground is a beautified version of one line):

slide with the HTML comment (illustration)

I have created a very simple and straightforward plugin that will display the same information, well visible and organized at the bottom of the page - note that the configuration required remains the same. This is a sample output that you'll find at the bottom of each page with this plugin:

Name Namespace Description Duration User Status URL/DisplayName Timeout/Portlet Id Attributes Type
103 c.l.m.Portlet null 0 null SUCCESS Tags Compiler 103   RENDER
56 c.l.m.Portlet null 36 null SUCCESS Journal Content 56_INSTANCE_JaLJR3MQtAYm   RENDER
101 c.l.m.Portlet null 130 null SUCCESS Asset Publisher 101_INSTANCE_0BVmhEtIm8dR   RENDER
/h/c/t/portal.jsp c.l.m.Portal Portal Request 629 null SUCCESS .../portal.jsp.jsp_display -1  

There's nothing fancy except the abbreviations (in italics): If you hover the mouse over them, you'll see what they're abbreviated from. If you can make use if this information - e.g. to find performance bottlenecks in your plugins and pages - this might be valuable information right at your fingertip. Feel free to use this as a starting point and explore more interactive and better solutions to display this data. Or deploy this to your test environment and parse the output to test for a specific portlet's performance.

Where is it?

You can find this plugin in its own branch on github: The only "actual" file that changes anything is bottom_monitoring.jsp - in the interest of keeping the implementation in a simple hook, everything is contained in that jsp.

Documentation for the required configuration is included in its README.html (or see the raw version on github on github)

Threaded Replies Author Date
I turned on monitoring, seems to be working on... Srinivas KK October 25, 2013 5:50 PM

I turned on monitoring, seems to be working on public pages , but failing on private pages.

java.lang.IllegalStateException: Stopwatch is not running.
org.apache.commons.lang.time.StopWatch.stop(StopWatch.java:142)
com.liferay.por­tal.monitoring.statistics.BaseDataSample.capture(BaseDataSample.java:35)
org.apa­che.jsp.html.common.themes.bottom_jsp._jspService(bottom_jsp.java:1877)
org.apac­he.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.Ht­tpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrap­per.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.ser­viceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(Js­pServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
­com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:72)
com.liferay.portal.kernel.servlet.filters.invoker.Invo­kerFilter.doFilter(InvokerFilter.java:70)
com.liferay.taglib.util.VelocityTaglib­.include(VelocityTaglib.java:377)
sun.reflect.GeneratedMethodAccessor433.invoke(­Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor­Impl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.veloci­ty.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:38­9)
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(Ube­rspectImpl.java:378)
org.apache.velocity.runtime.parser.node.ASTMethod.execute(A­STMethod.java:270)
org.apache.velocity.runtime.parser.node.ASTReference.execute(­ASTReference.java:262)
org.apache.velocity.runtime.parser.node.ASTReference.rend­er(ASTReference.java:342)
org.apache.velocity.runtime.parser.node.SimpleNode.ren­der(SimpleNode.java:336)
org.apache.velocity.Template.merge(Template.java:328)
o­rg.apache.velocity.Template.merge(Template.java:235)
org.apache.velocity.app.Vel­ocityEngine.mergeTemplate(VelocityEngine.java:381)
com.liferay.portal.velocity.V­elocityEngineImpl.mergeTemplate(VelocityEngineImpl.java:184)
com.liferay.portal.­velocity.VelocityEngineImpl.mergeTemplate(VelocityEngineImpl.java:194)
com.lifer­ay.portal.kernel.velocity.VelocityEngineUtil.mergeTemplate(VelocityEngineUtil.ja­va:71)
com.liferay.taglib.util.ThemeUtil.includeVM(ThemeUtil.java:409)
com.lifer­ay.taglib.util.ThemeUtil.include(ThemeUtil.java:99)
com.liferay.taglib.theme.Inc­ludeTag.doEndTag(IncludeTag.java:39)
org.apache.jsp.html.common.themes.portal_js­p._jspx_meth_liferay_002dtheme_005finclude_005f1(portal_jsp.java:484)
org.apache­.jsp.html.common.themes.portal_jsp._jspService(portal_jsp.java:429)
org.apache.j­asper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpSe­rvlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.­service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.service­JspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspSer­vlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
com.­liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(Invoke­rFilterChain.java:72)
com.liferay.portal.kernel.servlet.filters.invoker.InvokerF­ilter.doFilter(InvokerFilter.java:70)
com.liferay.portal.struts.StrutsUtil.inclu­de(StrutsUtil.java:135)
com.liferay.portal.struts.PortalRequestProcessor.doInclu­de(PortalRequestProcessor.java:289)
org.apache.struts.tiles.TilesRequestProcesso­r.processTilesDefinition(TilesRequestProcessor.java:237)
org.apache.struts.tiles­.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:302)
org.­apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
com.lif­eray.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:17­4)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.a­pache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.ht­tp.HttpServlet.service(HttpServlet.java:621)
com.liferay.portal.servlet.MainServ­let.callParentService(MainServlet.java:533)
com.liferay.portal.servlet.MainServl­et.service(MainServlet.java:510)
javax.servlet.http.HttpServlet.service(HttpServ­let.java:722)
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterCha­in.doFilter(InvokerFilterChain.java:72)
com.liferay.portal.kernel.servlet.BaseFi­lter.processFilter(BaseFilter.java:121)
com.liferay.portal.servlet.filters.monit­oring.MonitoringFilter.processFilter(MonitoringFilter.java:78)
Posted on 10/25/13 5:50 PM.