Friday, 14 May 2010

View GWT Metrics in Firebug

GWT's Lightweight Metrics System provides insight on latency issues. Unfortunately, using it requires downloading and compiling a debug module, or requires writing a javascript collector method.

Here's introducing gwtmetrics - a bookmarklet that allows you to view metrics for any GWT website without modifying code. The current version uses firebug's console to display metrics; the next version plans to use YUI's log console.

So if you have firebug enabled, drag this link to your bookmarks folder. Visit any GWT website (Orkut, for example), and click on the bookmark. You should see metrics getting logged in firebug.


This system provides a lot more insight than firebug's net panel. For example, it tells you the time spent in your AsyncCallback implementation. Additionally, if you add your own instrumentation, this framework would be able to display the metrics without any change.

If you would like more control, you can download the js library (no dependencies) and include it in your host.html just before your module.nocache.js file.

<script type="text/javascript" language="javascript" src="http://degwt.googlecode.com/svn/trunk/static/js/gwtmetrics.js"></script>
<script>gwtmetrics('firebug');</script>

Including the script obviously requires a code change, but it allows you to view  startup metrics that's not possible with the bookmarklet.

Comments and feedback are welcome. If you encounter a problem, leave a message, or better, create an issue.

--Sri

0 comments:

Post a Comment