Changeset 96222 in webkit


Ignore:
Timestamp:
Sep 28, 2011 7:30:54 AM (13 years ago)
Author:
loislo@chromium.org
Message:

Web Inspector: It'd be useful to have performance stats for the back-end to front-end communication channel.
https://bugs.webkit.org/show_bug.cgi?id=69002

Reviewed by Yury Semikhatsky.

  • inspector/CodeGeneratorInspector.pm:
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r96219 r96222  
     12011-09-28  Ilya Tikhonovsky  <loislo@chromium.org>
     2
     3        Web Inspector: It'd be useful to have performance stats for the back-end to front-end communication channel.
     4        https://bugs.webkit.org/show_bug.cgi?id=69002
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        * inspector/CodeGeneratorInspector.pm:
     9
    1102011-09-27  Pavel Podivilov  <podivilov@chromium.org>
    211
  • trunk/Source/WebCore/inspector/CodeGeneratorInspector.pm

    r95632 r96222  
    777777
    778778InspectorBackendStub.prototype = {
     779    dumpInspectorTimeStats: 0,
     780    dumpInspectorProtocolMessages: 0,
     781
    779782    _wrap: function(callback)
    780783    {
     
    850853    _wrapCallbackAndSendMessageObject: function(messageObject, callback)
    851854    {
    852         messageObject.id = this._wrap(callback || function() {});
    853 
    854         if (window.dumpInspectorProtocolMessages)
     855        messageObject.id = this._wrap(callback);
     856
     857        if (this.dumpInspectorTimeStats) {
     858            var wrappedCallback = this._callbacks[messageObject.id];
     859            wrappedCallback.methodName = messageObject.method;
     860            wrappedCallback.sendRequestTime = Date.now();
     861        }
     862
     863        if (this.dumpInspectorProtocolMessages)
    855864            console.log("frontend: " + JSON.stringify(messageObject));
    856865
     
    873882    dispatch: function(message)
    874883    {
    875         if (window.dumpInspectorProtocolMessages)
     884        if (this.dumpInspectorProtocolMessages)
    876885            console.log("backend: " + ((typeof message === "string") ? message : JSON.stringify(message)));
    877886
     
    917926            var callback = this._callbacks[messageObject.id];
    918927            if (callback) {
     928                var processingStartTime;
     929                if (this.dumpInspectorTimeStats && callback.methodName)
     930                    processingStartTime = Date.now();
     931
    919932                arguments.unshift(messageObject.error);
    920933                callback.apply(null, arguments);
    921934                --this._pendingResponsesCount;
    922935                delete this._callbacks[messageObject.id];
     936
     937                if (this.dumpInspectorTimeStats && callback.methodName)
     938                    console.log("time-stats: " + callback.methodName + " = " + (processingStartTime - callback.sendRequestTime) + " + " + (Date.now() - processingStartTime));
    923939            }
    924940
     
    953969            }
    954970
     971            var processingStartTime;
     972            if (this.dumpInspectorTimeStats)
     973                processingStartTime = Date.now();
     974
    955975            dispatcher[functionName].apply(dispatcher, params);
     976
     977            if (this.dumpInspectorTimeStats)
     978                console.log("time-stats: " + messageObject.method + " = " + (Date.now() - processingStartTime));
    956979        }
    957980    },
Note: See TracChangeset for help on using the changeset viewer.