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

      0  

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

    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
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,414
    Vote Rating
    179
    Answers
    13
    LesJ is a splendid one to behold LesJ is a splendid one to behold LesJ is a splendid one to behold LesJ is a splendid one to behold LesJ is a splendid one to behold LesJ is a splendid one to behold LesJ is a splendid one to behold

      0  

  3. #3
    Ext JS Premium Member
    Join Date
    May 2008
    Posts
    374
    Vote Rating
    13
    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
    544
    Vote Rating
    31
    Answers
    6
    SebTardif will become famous soon enough SebTardif will become famous soon enough

      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