Web Inspector: introduce UserMetrics for collecting stats in Chromium port.
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Jul 2011 18:20:16 +0000 (18:20 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Jul 2011 18:20:16 +0000 (18:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=64350

Reviewed by Yury Semikhatsky.

Source/WebCore:

Test: inspector/user-metrics.html

* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* bindings/js/JSInspectorFrontendHostCustom.cpp:
(WebCore::JSInspectorFrontendHost::recordActionTaken):
(WebCore::JSInspectorFrontendHost::recordPanelShown):
(WebCore::JSInspectorFrontendHost::recordSettingChanged):
* bindings/v8/custom/V8InspectorFrontendHostCustom.cpp:
(WebCore::histogramEnumeration):
(WebCore::V8InspectorFrontendHost::recordActionTakenCallback):
(WebCore::V8InspectorFrontendHost::recordPanelShownCallback):
(WebCore::V8InspectorFrontendHost::recordSettingChangedCallback):
* inspector/InspectorFrontendHost.idl:
* inspector/front-end/AuditsPanel.js:
(WebInspector.AuditsPanel.prototype.initiateAudit):
* inspector/front-end/ConsoleView.js:
* inspector/front-end/DebuggerModel.js:
(WebInspector.DebuggerModel.prototype.setBreakpoint):
(WebInspector.DebuggerModel.prototype.setBreakpointBySourceId):
* inspector/front-end/InspectorFrontendHostStub.js:
(.WebInspector.InspectorFrontendHostStub.prototype.loadSessionSetting):
(.WebInspector.InspectorFrontendHostStub.prototype.recordActionTaken):
(.WebInspector.InspectorFrontendHostStub.prototype.recordPanelShown):
(.WebInspector.InspectorFrontendHostStub.prototype.recordSettingChanged):
* inspector/front-end/ProfilesPanel.js:
(WebInspector.ProfilesPanel.prototype._setRecordingProfile):
(WebInspector.ProfilesPanel.prototype.takeHeapSnapshot):
* inspector/front-end/TimelinePanel.js:
(WebInspector.TimelinePanel.prototype._toggleTimelineButtonClicked):
* inspector/front-end/UserMetrics.js: Added.
(WebInspector.UserMetrics.settingChanged):
(WebInspector.UserMetrics):
(WebInspector.UserMetrics.prototype.panelShown):
(WebInspector.UserMetrics._Recorder):
(WebInspector.UserMetrics._Recorder.prototype.record):
* inspector/front-end/WebKit.qrc:
* inspector/front-end/inspector.html:
* inspector/front-end/inspector.js:
(WebInspector._toggleAttach):

LayoutTests:

* inspector/user-metrics-expected.txt: Added.
* inspector/user-metrics.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@90830 268f45cc-cd09-0410-ab3c-d52691b4dbfc

19 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector/user-metrics-expected.txt [new file with mode: 0644]
LayoutTests/inspector/user-metrics.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
Source/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp
Source/WebCore/inspector/InspectorFrontendHost.idl
Source/WebCore/inspector/front-end/AuditsPanel.js
Source/WebCore/inspector/front-end/ConsoleView.js
Source/WebCore/inspector/front-end/DebuggerModel.js
Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js
Source/WebCore/inspector/front-end/ProfilesPanel.js
Source/WebCore/inspector/front-end/TimelinePanel.js
Source/WebCore/inspector/front-end/UserMetrics.js [new file with mode: 0644]
Source/WebCore/inspector/front-end/WebKit.qrc
Source/WebCore/inspector/front-end/inspector.html
Source/WebCore/inspector/front-end/inspector.js

index 75840cd..4b8f0d2 100644 (file)
@@ -1,3 +1,13 @@
+2011-07-12  Pavel Feldman  <pfeldman@google.com>
+
+        Web Inspector: introduce UserMetrics for collecting stats in Chromium port.
+        https://bugs.webkit.org/show_bug.cgi?id=64350
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/user-metrics-expected.txt: Added.
+        * inspector/user-metrics.html: Added.
+
 2011-07-12  Jeff Timanus  <twiz@chromium.org>
 
         Reviewed by Stephen White.
diff --git a/LayoutTests/inspector/user-metrics-expected.txt b/LayoutTests/inspector/user-metrics-expected.txt
new file mode 100644 (file)
index 0000000..5cef138
--- /dev/null
@@ -0,0 +1,49 @@
+Tests list of user metrics codes and invocations.
+
+recordActionTaken:
+{
+    WindowDocked : 1
+    WindowUndocked : 2
+    ScriptsBreakpointSet : 3
+    TimelineStarted : 4
+    ProfilesCPUProfileTaken : 5
+    ProfilesHeapProfileTaken : 6
+    AuditsStarted : 7
+    ConsoleEvaluated : 8
+}
+Action taken: WindowDocked
+Action taken: WindowUndocked
+
+recordPanelShown:
+{
+    elements : 1
+    resources : 2
+    network : 3
+    scripts : 4
+    timeline : 5
+    profiles : 6
+    audits : 7
+    console : 8
+}
+Panel shown: profiles
+Panel shown: timeline
+Panel shown: audits
+
+recordSettingChanged:
+{
+    ElementsDOMWrapOn : 1
+    ElementsDOMWrapOff : 2
+    ConsoleMonitorXHROn : 3
+    ConsoleMonitorXHROff : 4
+    ConsolePreserveLogOn : 5
+    ConsolePreserveLogOff : 6
+    NetworkShowLargeRowsOn : 7
+    NetworkShowLargeRowsOff : 8
+}
+Setting changed: ConsoleMonitorXHROn
+Setting changed: ConsoleMonitorXHROff
+Setting changed: ConsolePreserveLogOn
+Setting changed: ConsolePreserveLogOff
+Setting changed: NetworkShowLargeRowsOff
+Setting changed: NetworkShowLargeRowsOn
+
diff --git a/LayoutTests/inspector/user-metrics.html b/LayoutTests/inspector/user-metrics.html
new file mode 100644 (file)
index 0000000..44bbe71
--- /dev/null
@@ -0,0 +1,62 @@
+<html>
+<head>
+<script src="../http/tests/inspector/inspector-test.js"></script>
+<script>
+
+function test()
+{
+    InspectorFrontendHost.recordActionTaken = function(actionCode)
+    {
+        InspectorTest.addResult("Action taken: " + nameOf(WebInspector.UserMetrics._ActionCodes, actionCode));
+    }
+
+    InspectorFrontendHost.recordPanelShown = function(panelCode)
+    {
+        InspectorTest.addResult("Panel shown: " + nameOf(WebInspector.UserMetrics._PanelCodes, panelCode));
+    }
+
+    InspectorFrontendHost.recordSettingChanged = function(settingCode)
+    {
+        InspectorTest.addResult("Setting changed: " + nameOf(WebInspector.UserMetrics._SettingCodes, settingCode));
+    }
+
+    function nameOf(object, code)
+    {
+        for (var name in object) {
+            if (object[name] === code)
+                return name;
+        }
+        return null;
+    }
+
+    InspectorTest.addResult("recordActionTaken:");
+    InspectorTest.dump(WebInspector.UserMetrics._ActionCodes);
+    WebInspector.userMetrics.WindowDocked.record();
+    WebInspector.userMetrics.WindowUndocked.record();
+
+    InspectorTest.addResult("\nrecordPanelShown:");
+    InspectorTest.dump(WebInspector.UserMetrics._PanelCodes);
+    WebInspector.showPanel("profiles");
+    WebInspector.showPanel("timeline");
+    WebInspector.showPanel("audits");
+
+    InspectorTest.addResult("\nrecordSettingChanged:");
+    InspectorTest.dump(WebInspector.UserMetrics._SettingCodes);
+    WebInspector.settings.monitoringXHREnabled.set(true);
+    WebInspector.settings.monitoringXHREnabled.set(false);
+    WebInspector.settings.preserveConsoleLog.set(true);
+    WebInspector.settings.preserveConsoleLog.set(false);
+    WebInspector.settings.resourcesLargeRows.set(false);
+    WebInspector.settings.resourcesLargeRows.set(true);
+
+    InspectorTest.completeTest();
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>Tests list of user metrics codes and invocations.</p>
+
+</body>
+</html>
index cc1b1f9..f1cbaf5 100644 (file)
@@ -1,3 +1,51 @@
+2011-07-12  Pavel Feldman  <pfeldman@google.com>
+
+        Web Inspector: introduce UserMetrics for collecting stats in Chromium port.
+        https://bugs.webkit.org/show_bug.cgi?id=64350
+
+        Reviewed by Yury Semikhatsky.
+
+        Test: inspector/user-metrics.html
+
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * bindings/js/JSInspectorFrontendHostCustom.cpp:
+        (WebCore::JSInspectorFrontendHost::recordActionTaken):
+        (WebCore::JSInspectorFrontendHost::recordPanelShown):
+        (WebCore::JSInspectorFrontendHost::recordSettingChanged):
+        * bindings/v8/custom/V8InspectorFrontendHostCustom.cpp:
+        (WebCore::histogramEnumeration):
+        (WebCore::V8InspectorFrontendHost::recordActionTakenCallback):
+        (WebCore::V8InspectorFrontendHost::recordPanelShownCallback):
+        (WebCore::V8InspectorFrontendHost::recordSettingChangedCallback):
+        * inspector/InspectorFrontendHost.idl:
+        * inspector/front-end/AuditsPanel.js:
+        (WebInspector.AuditsPanel.prototype.initiateAudit):
+        * inspector/front-end/ConsoleView.js:
+        * inspector/front-end/DebuggerModel.js:
+        (WebInspector.DebuggerModel.prototype.setBreakpoint):
+        (WebInspector.DebuggerModel.prototype.setBreakpointBySourceId):
+        * inspector/front-end/InspectorFrontendHostStub.js:
+        (.WebInspector.InspectorFrontendHostStub.prototype.loadSessionSetting):
+        (.WebInspector.InspectorFrontendHostStub.prototype.recordActionTaken):
+        (.WebInspector.InspectorFrontendHostStub.prototype.recordPanelShown):
+        (.WebInspector.InspectorFrontendHostStub.prototype.recordSettingChanged):
+        * inspector/front-end/ProfilesPanel.js:
+        (WebInspector.ProfilesPanel.prototype._setRecordingProfile):
+        (WebInspector.ProfilesPanel.prototype.takeHeapSnapshot):
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel.prototype._toggleTimelineButtonClicked):
+        * inspector/front-end/UserMetrics.js: Added.
+        (WebInspector.UserMetrics.settingChanged):
+        (WebInspector.UserMetrics):
+        (WebInspector.UserMetrics.prototype.panelShown):
+        (WebInspector.UserMetrics._Recorder):
+        (WebInspector.UserMetrics._Recorder.prototype.record):
+        * inspector/front-end/WebKit.qrc:
+        * inspector/front-end/inspector.html:
+        * inspector/front-end/inspector.js:
+        (WebInspector._toggleAttach):
+
 2011-07-12  Pratik Solanki  <psolanki@apple.com>
 
         Reviewed by David Kilzer.
index 06a2996..869d278 100644 (file)
             'inspector/front-end/Toolbar.js',
             'inspector/front-end/TopDownProfileDataGridTree.js',
             'inspector/front-end/treeoutline.js',
+            'inspector/front-end/UserMetrics.js',
             'inspector/front-end/utilities.js',
             'inspector/front-end/View.js',
             'inspector/front-end/WatchExpressionsSidebarPane.js',
index f3f44f6..d26a363 100755 (executable)
                                        >
                                </File>
                                <File
+                                       RelativePath="..\inspector\front-end\UserMetrics.js"
+                                       >
+                               </File>
+                               <File
                                        RelativePath="..\inspector\front-end\utilities.js"
                                        >
                                </File>
index ab6a1ad..f5f28f6 100644 (file)
@@ -126,6 +126,21 @@ JSValue JSInspectorFrontendHost::showContextMenu(ExecState* exec)
     return jsUndefined();
 }
 
+JSValue JSInspectorFrontendHost::recordActionTaken(ExecState*)
+{
+    return jsUndefined();
+}
+
+JSValue JSInspectorFrontendHost::recordPanelShown(ExecState*)
+{
+    return jsUndefined();
+}
+
+JSValue JSInspectorFrontendHost::recordSettingChanged(ExecState*)
+{
+    return jsUndefined();
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)
index c5608d6..ba78a49 100644 (file)
@@ -35,6 +35,7 @@
 #include "InspectorController.h"
 #include "InspectorFrontendClient.h"
 #include "InspectorFrontendHost.h"
+#include "PlatformBridge.h"
 #include "PlatformString.h"
 
 #include "V8Binding.h"
@@ -114,6 +115,33 @@ v8::Handle<v8::Value> V8InspectorFrontendHost::showContextMenuCallback(const v8:
     return v8::Undefined();
 }
 
+static v8::Handle<v8::Value> histogramEnumeration(const char* name, const v8::Arguments& args, int boundaryValue)
+{
+    if (args.Length() < 1 || !args[0]->IsInt32())
+        return v8::Undefined();
+
+    int sample = args[0]->ToInt32()->Value();
+    if (sample < boundaryValue)
+        PlatformBridge::histogramEnumeration(name, sample, boundaryValue);
+
+    return v8::Undefined();
+}
+
+v8::Handle<v8::Value> V8InspectorFrontendHost::recordActionTakenCallback(const v8::Arguments& args)
+{
+    return histogramEnumeration("DevTools.ActionTaken", args, 100);
+}
+
+v8::Handle<v8::Value> V8InspectorFrontendHost::recordPanelShownCallback(const v8::Arguments& args)
+{
+    return histogramEnumeration("DevTools.PanelShown", args, 20);
+}
+
+v8::Handle<v8::Value> V8InspectorFrontendHost::recordSettingChangedCallback(const v8::Arguments& args)
+{
+    return histogramEnumeration("DevTools.SettingChanged", args, 100);
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)
index 87f873d..ed04ab8 100644 (file)
@@ -60,5 +60,9 @@ module core {
         [Custom] DOMString port();
         [Custom] void showContextMenu(in MouseEvent event, in DOMObject items);
         void sendMessageToBackend(in DOMString message);
+
+        [Custom] void recordActionTaken(in unsigned long actionCode);
+        [Custom] void recordPanelShown(in unsigned long panelCode);
+        [Custom] void recordSettingChanged(in unsigned long settingChanged);
     };
 }
index cc8c948..4ba74dd 100644 (file)
@@ -190,6 +190,8 @@ WebInspector.AuditsPanel.prototype = {
             initiateAuditCallback.call(this, categories, launcherCallback);
         else
             this._reloadResources(initiateAuditCallback.bind(this, categories, launcherCallback));
+
+        WebInspector.userMetrics.AuditsStarted.record();
     },
 
     _reloadResources: function(callback)
index 88d01cb..6b3c6ef 100644 (file)
@@ -609,6 +609,8 @@ WebInspector.ConsoleView.prototype = {
             self.addMessage(new WebInspector.ConsoleCommandResult(result, wasThrown, commandMessage));
         }
         this.evalInInspectedWindow(str, "console", true, printResult);
+
+        WebInspector.userMetrics.ConsoleEvaluated.record();
     },
 
     _format: function(output, forceObjectFormat)
index 4c8fcf2..cf340c8 100644 (file)
@@ -90,6 +90,7 @@ WebInspector.DebuggerModel.prototype = {
                 callback(error ? null : breakpointId, locations);
         }
         DebuggerAgent.setBreakpointByUrl(url, lineNumber, columnNumber, condition, didSetBreakpoint.bind(this));
+        WebInspector.userMetrics.ScriptsBreakpointSet.record();
     },
 
     setBreakpointBySourceId: function(location, condition, callback)
@@ -100,6 +101,7 @@ WebInspector.DebuggerModel.prototype = {
                 callback(error ? null : breakpointId, [actualLocation]);
         }
         DebuggerAgent.setBreakpoint(location, condition, didSetBreakpoint.bind(this));
+        WebInspector.userMetrics.ScriptsBreakpointSet.record();
     },
 
     removeBreakpoint: function(breakpointId, callback)
index 645a8c7..baf7cc7 100644 (file)
@@ -144,6 +144,18 @@ WebInspector.InspectorFrontendHostStub.prototype = {
 
     loadSessionSetting: function(key)
     {
+    },
+
+    recordActionTaken: function(actionCode)
+    {
+    },
+
+    recordPanelShown: function(panelCode)
+    {
+    },
+
+    recordSettingChanged: function(settingCode)
+    {
     }
 }
 
index 0ae6f40..8ba94bf 100644 (file)
@@ -658,9 +658,10 @@ WebInspector.ProfilesPanel.prototype = {
                     isTemporary: true
                 };
             }
-            if (isProfiling)
+            if (isProfiling) {
                 this._addProfileHeader(this._temporaryRecordingProfile);
-            else
+                WebInspector.userMetrics.ProfilesCPUProfileTaken.record();
+            } else
                 this._removeProfileHeader(this._temporaryRecordingProfile);
         }
         this.updateProfileTypeButtons();
@@ -680,6 +681,7 @@ WebInspector.ProfilesPanel.prototype = {
             this._addProfileHeader(this._temporaryTakingSnapshot);
         }
         ProfilerAgent.takeHeapSnapshot();
+        WebInspector.userMetrics.ProfilesHeapProfileTaken.record();
     },
 
     _reportHeapSnapshotProgress: function(done, total)
index e4f015e..66e6c8b 100644 (file)
@@ -278,6 +278,7 @@ WebInspector.TimelinePanel.prototype = {
         else {
             this._clearPanel();
             WebInspector.timelineManager.start();
+            WebInspector.userMetrics.TimelineStarted.record();
         }
         this.toggleTimelineButton.toggled = !this.toggleTimelineButton.toggled;
     },
diff --git a/Source/WebCore/inspector/front-end/UserMetrics.js b/Source/WebCore/inspector/front-end/UserMetrics.js
new file mode 100644 (file)
index 0000000..c2bb050
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.UserMetrics = function()
+{
+    for (var actionName in WebInspector.UserMetrics._ActionCodes) {
+        var actionCode = WebInspector.UserMetrics._ActionCodes[actionName];
+        this[actionName] = new WebInspector.UserMetrics._Recorder(actionCode);
+    }
+
+    function settingChanged(trueCode, falseCode, event)
+    {
+        if (event.data)
+            InspectorFrontendHost.recordSettingChanged(trueCode);
+        else
+            InspectorFrontendHost.recordSettingChanged(falseCode);
+    }
+
+    WebInspector.settings.domWordWrap.addChangeListener(settingChanged.bind(this, WebInspector.UserMetrics._SettingCodes.ElementsDOMWrapOn, WebInspector.UserMetrics._SettingCodes.ElementsDOMWrapOff));
+    WebInspector.settings.monitoringXHREnabled.addChangeListener(settingChanged.bind(this, WebInspector.UserMetrics._SettingCodes.ConsoleMonitorXHROn, WebInspector.UserMetrics._SettingCodes.ConsoleMonitorXHROff));
+    WebInspector.settings.preserveConsoleLog.addChangeListener(settingChanged.bind(this, WebInspector.UserMetrics._SettingCodes.ConsolePreserveLogOn, WebInspector.UserMetrics._SettingCodes.ConsolePreserveLogOff));
+    WebInspector.settings.resourcesLargeRows.addChangeListener(settingChanged.bind(this, WebInspector.UserMetrics._SettingCodes.NetworkShowLargeRowsOn, WebInspector.UserMetrics._SettingCodes.NetworkShowLargeRowsOff));
+}
+
+// Codes below are used to collect UMA histograms in the Chromium port.
+// Do not change the values below, additional actions are needed on the Chromium side
+// in order to add more codes.
+
+WebInspector.UserMetrics._ActionCodes = {
+    WindowDocked: 1,
+    WindowUndocked: 2,
+    ScriptsBreakpointSet: 3,
+    TimelineStarted: 4,
+    ProfilesCPUProfileTaken: 5,
+    ProfilesHeapProfileTaken: 6,
+    AuditsStarted: 7,
+    ConsoleEvaluated: 8
+}
+
+WebInspector.UserMetrics._SettingCodes = {
+    ElementsDOMWrapOn: 1,
+    ElementsDOMWrapOff: 2,
+    ConsoleMonitorXHROn: 3,
+    ConsoleMonitorXHROff: 4,
+    ConsolePreserveLogOn: 5,
+    ConsolePreserveLogOff: 6,
+    NetworkShowLargeRowsOn: 7,
+    NetworkShowLargeRowsOff: 8
+}
+
+WebInspector.UserMetrics._PanelCodes = {
+    elements: 1,
+    resources: 2,
+    network: 3,
+    scripts: 4,
+    timeline: 5,
+    profiles: 6,
+    audits: 7,
+    console: 8
+}
+
+WebInspector.UserMetrics.prototype = {
+    panelShown: function(panelName)
+    {
+        InspectorFrontendHost.recordPanelShown(WebInspector.UserMetrics._PanelCodes[panelName] || 0);
+    }
+}
+
+WebInspector.UserMetrics._Recorder = function(actionCode)
+{
+    this._actionCode = actionCode;
+}
+
+WebInspector.UserMetrics._Recorder.prototype = {
+    record: function()
+    {
+        InspectorFrontendHost.recordActionTaken(this._actionCode);
+    }
+}
index 9821dc2..2eaf5b7 100644 (file)
     <file>Toolbar.js</file>
     <file>TopDownProfileDataGridTree.js</file>
     <file>treeoutline.js</file>
+    <file>UserMetrics.js</file>
     <file>utilities.js</file>
     <file>View.js</file>
     <file>WatchExpressionsSidebarPane.js</file>
index e15bfef..9356829 100644 (file)
@@ -167,6 +167,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     <script type="text/javascript" src="Toolbar.js"></script>
     <script type="text/javascript" src="SearchController.js"></script>
     <script type="text/javascript" src="WorkerManager.js"></script>
+    <script type="text/javascript" src="UserMetrics.js"></script>
 </head>
 <body class="detached">
     <div id="toolbar">
index b5e3709..648fd41 100644 (file)
@@ -147,6 +147,7 @@ var WebInspector = {
             if (WebInspector.panels[panelName] === x) {
                 WebInspector.settings.lastActivePanel.set(panelName);
                 this._panelHistory.setPanel(panelName);
+                WebInspector.userMetrics.panelShown(panelName);
             }
         }
     },
@@ -202,10 +203,13 @@ var WebInspector = {
 
     _toggleAttach: function()
     {
-        if (!this._attached)
+        if (!this._attached) {
             InspectorFrontendHost.requestAttachWindow();
-        else
+            WebInspector.userMetrics.WindowDocked.record();
+        } else {
             InspectorFrontendHost.requestDetachWindow();
+            WebInspector.userMetrics.WindowUndocked.record();
+        }
     },
 
     _toggleSettings: function()
@@ -483,6 +487,7 @@ WebInspector.doLoadedDone = function()
         document.body.addStyleClass("remote");
 
     WebInspector.settings = new WebInspector.Settings();
+    WebInspector.userMetrics = new WebInspector.UserMetrics();
 
     this._registerShortcuts();