1. #1
    Ext JS Premium Member
    Join Date
    May 2008
    Posts
    376
    Vote Rating
    20
    ttbgwt will become famous soon enough

      0  

    Default Unanswered: suggestions on how to measure time it takes to get data from server?

    We want to offer a debug area in our app that will show each server side call that is being made, and the time it takes to get the call back. Any suggestions on how to approach this? We can show the calls being made, but are not sure of approach to generically calculate timing of each call?

    Code:
            // Capture JsonP events for debug/trace
            Ext.override(Ext.data.JsonP, {
                handleResponse: function (result, request) {
                    console.debug('JsonP request made to ' + request.url);
                    this.callParent(arguments);
                }
            });
            // Capture Ajax events for debug/trace
            Ext.util.Observable.observe(Ext.data.Connection);
            Ext.data.Connection.on('beforerequest', function (con, options) {
                console.log('Ajax request made to ' + options.url);
            });

  2. #2
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,700
    Vote Rating
    493
    Answers
    18
    LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future

      0  

  3. #3
    Ext JS Premium Member
    Join Date
    May 2008
    Posts
    376
    Vote Rating
    20
    ttbgwt will become famous soon enough

      0  

    Default

    I want to build this into our app, we already use firebug for debugging our code...

  4. #4
    Ext JS Premium Member SebTardif's Avatar
    Join Date
    Feb 2011
    Location
    Cambridge, MA
    Posts
    1,018
    Vote Rating
    74
    Answers
    8
    SebTardif is a jewel in the rough SebTardif is a jewel in the rough SebTardif is a jewel in the rough

      0  

    Default

    You should use the Filter pattern on your server side. In Java, the Servlet specification has a mechanism called "Filter", you can intercept start and end of all requests, calculate the time, and then call your prefered logger.

Thread Participants: 2