/** * gwtmetrics is a utility to report metrics for any GWT application. * * gwtmetrics can be included as a static library as follows - *
* * * * ** * gwtmetrics can also be included dynamically as a bookmarklet, * making it possible to get metrics for any running GWT application WITHOUT changing code. * * gwtmetrics plugs into GWTs Lightweight Metrics System (http://code.google.com/webtoolkit/doc/latest/DevGuideLightweightMetrics.html) * The numbers are instrumented by GWT in every application, so gwtmetrics.js only does the job of listening, collating and reporting. * */ function gwtmetrics(loggerType) { var wnd = window; var doc = document; var collatedEvents = []; var getGWTContentWindows = function () { var toreturn = []; //Some GWT linkers put the javascript methods inline, and so we can test the window object if (wnd.$gwt_version) { toreturn.push(wnd); } //but more frequently, the iframe linker puts all GWT methods in an iframe var iframes = doc.getElementsByTagName('iframe'); for (var i=0; i