Results 1 to 4 of 4

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

  1. #1
    Ext JS Premium Member
    Join Date
    May 2008
    Posts
    427
    Vote Rating
    22
      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,909
    Answers
    18
    Vote Rating
    544
      0  

  3. #3
    Ext JS Premium Member
    Join Date
    May 2008
    Posts
    427
    Vote Rating
    22
      0  

    Default

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

  4. #4
    Sencha Premium User SebTardif's Avatar
    Join Date
    Feb 2011
    Location
    Cambridge, MA
    Posts
    1,103
    Answers
    12
    Vote Rating
    98
      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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •