Bug 1061759 - Profiler 'calls' columns is improperly named, r=pbrosset
authorVictor Porof <vporof@mozilla.com>
Fri, 19 Sep 2014 08:55:53 -0400
changeset 206239 c5247437d857469b0f280e125a95d2da73d40b13
parent 206238 3243776bed0e1fbaea3a72fd839031356da08159
child 206240 30a7753deb4bda89d84600c6c9b37d2ec1d29210
push id27517
push userryanvm@gmail.com
push dateFri, 19 Sep 2014 18:13:39 +0000
treeherdermozilla-central@a084c4cfd8a1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbrosset
bugs1061759
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1061759 - Profiler 'calls' columns is improperly named, r=pbrosset
browser/devtools/profiler/profiler.xul
browser/devtools/profiler/test/browser_profiler_data-massaging-01.js
browser/devtools/profiler/test/browser_profiler_tree-model-01.js
browser/devtools/profiler/test/browser_profiler_tree-view-01.js
browser/devtools/profiler/test/browser_profiler_tree-view-02.js
browser/devtools/profiler/test/browser_profiler_tree-view-04.js
browser/devtools/profiler/utils/tree-model.js
browser/devtools/profiler/utils/tree-view.js
browser/locales/en-US/chrome/browser/devtools/profiler.dtd
browser/themes/shared/devtools/profiler.inc.css
--- a/browser/devtools/profiler/profiler.xul
+++ b/browser/devtools/profiler/profiler.xul
@@ -108,19 +108,19 @@
                  type="duration"
                  crop="end"
                  value="&profilerUI.table.duration;"/>
           <label class="plain call-tree-header"
                  type="percentage"
                  crop="end"
                  value="&profilerUI.table.percentage;"/>
           <label class="plain call-tree-header"
-                 type="invocations"
+                 type="samples"
                  crop="end"
-                 value="&profilerUI.table.invocations;"/>
+                 value="&profilerUI.table.samples;"/>
           <label class="plain call-tree-header"
                  type="function"
                  crop="end"
                  value="&profilerUI.table.function;"/>
         </hbox>
         <vbox class="call-tree-cells-container" flex="1"/>
       </vbox>
     </tabpanel>
--- a/browser/devtools/profiler/test/browser_profiler_data-massaging-01.js
+++ b/browser/devtools/profiler/test/browser_profiler_data-massaging-01.js
@@ -1,9 +1,9 @@
-s/* Any copyright is dedicated to the Public Domain.
+/* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests if the retrieved profiler data samples are correctly filtered and
  * normalized before passed to consumers.
  */
 
 const WAIT_TIME = 1000; // ms
--- a/browser/devtools/profiler/test/browser_profiler_tree-model-01.js
+++ b/browser/devtools/profiler/test/browser_profiler_tree-model-01.js
@@ -125,51 +125,51 @@ function test() {
 
   is(Object.keys(root.calls.A.calls.B.calls.C.calls.D.calls.E.calls.F.calls.G.calls).length, 0,
     "The correct number of child calls were calculated for the '.A.B.D.E.F.G' node.");
   is(Object.keys(root.calls.A.calls.B.calls.D.calls).length, 0,
     "The correct number of child calls were calculated for the '.A.B.D' node.");
   is(Object.keys(root.calls.A.calls.E.calls.F.calls).length, 0,
     "The correct number of child calls were calculated for the '.A.E.F' node.");
 
-  // Check the location, sample times, duration and invocations of the root.
+  // Check the location, sample times, duration and samples of the root.
 
   is(root.calls.A.location, "A",
     "The '.A' node has the correct location.");
   is(root.calls.A.sampleTimes.toSource(),
     "[{start:5, end:10}, {start:11, end:17}, {start:18, end:25}, {start:20, end:22}]",
     "The '.A' node has the correct sample times.");
   is(root.calls.A.duration, 20,
     "The '.A' node has the correct duration in milliseconds.");
-  is(root.calls.A.invocations, 4,
-    "The '.A' node has the correct number of invocations.");
+  is(root.calls.A.samples, 4,
+    "The '.A' node has the correct number of samples.");
 
   // ...and the rightmost leaf.
 
   is(root.calls.A.calls.E.calls.F.location, "F",
     "The '.A.E.F' node has the correct location.");
   is(root.calls.A.calls.E.calls.F.sampleTimes.toSource(),
     "[{start:18, end:25}]",
     "The '.A.E.F' node has the correct sample times.");
   is(root.calls.A.calls.E.calls.F.duration, 7,
     "The '.A.E.F' node has the correct duration in milliseconds.");
-  is(root.calls.A.calls.E.calls.F.invocations, 1,
-    "The '.A.E.F' node has the correct number of invocations.");
+  is(root.calls.A.calls.E.calls.F.samples, 1,
+    "The '.A.E.F' node has the correct number of samples.");
 
   // ...and the leftmost leaf.
 
   is(root.calls.A.calls.B.calls.C.calls.D.calls.E.calls.F.calls.G.location, "G",
     "The '.A.B.C.D.E.F.G' node has the correct location.");
   is(root.calls.A.calls.B.calls.C.calls.D.calls.E.calls.F.calls.G.sampleTimes.toSource(),
     "[{start:20, end:22}]",
     "The '.A.B.C.D.E.F.G' node has the correct sample times.");
   is(root.calls.A.calls.B.calls.C.calls.D.calls.E.calls.F.calls.G.duration, 2,
     "The '.A.B.C.D.E.F.G' node has the correct duration in milliseconds.");
-  is(root.calls.A.calls.B.calls.C.calls.D.calls.E.calls.F.calls.G.invocations, 1,
-    "The '.A.B.C.D.E.F.G' node has the correct number of invocations.");
+  is(root.calls.A.calls.B.calls.C.calls.D.calls.E.calls.F.calls.G.samples, 1,
+    "The '.A.B.C.D.E.F.G' node has the correct number of samples.");
 
   finish();
 }
 
 let gSamples = [{
   time: 5,
   frames: [
     { location: "(root)" },
--- a/browser/devtools/profiler/test/browser_profiler_tree-view-01.js
+++ b/browser/devtools/profiler/test/browser_profiler_tree-view-01.js
@@ -32,20 +32,20 @@ function test() {
   is(container.childNodes[0].childNodes[0].getAttribute("value"), "18",
     "The root node in the tree has the correct duration cell value.");
 
   is(container.childNodes[0].childNodes[1].getAttribute("type"), "percentage",
     "The root node in the tree has a percentage cell.");
   is(container.childNodes[0].childNodes[1].getAttribute("value"), "100%",
     "The root node in the tree has the correct percentage cell value.");
 
-  is(container.childNodes[0].childNodes[2].getAttribute("type"), "invocations",
-    "The root node in the tree has an invocations cell.");
+  is(container.childNodes[0].childNodes[2].getAttribute("type"), "samples",
+    "The root node in the tree has an samples cell.");
   is(container.childNodes[0].childNodes[2].getAttribute("value"), "",
-    "The root node in the tree has the correct invocations cell value.");
+    "The root node in the tree has the correct samples cell value.");
 
   is(container.childNodes[0].childNodes[3].getAttribute("type"), "function",
     "The root node in the tree has a function cell.");
   is(container.childNodes[0].childNodes[3].style.MozMarginStart, "0px",
     "The root node in the tree has the correct indentation.");
 
   finish();
 }
--- a/browser/devtools/profiler/test/browser_profiler_tree-view-02.js
+++ b/browser/devtools/profiler/test/browser_profiler_tree-view-02.js
@@ -15,29 +15,29 @@ function test() {
 
   let container = document.createElement("vbox");
   treeRoot.autoExpandDepth = 0;
   treeRoot.attachTo(container);
 
   let $$fun = node => container.querySelectorAll(".call-tree-cell[type=function] > " + node);
   let $$dur = i => container.querySelectorAll(".call-tree-cell[type=duration]")[i];
   let $$perc = i => container.querySelectorAll(".call-tree-cell[type=percentage]")[i];
-  let $$invoc = i => container.querySelectorAll(".call-tree-cell[type=invocations]")[i];
+  let $$sampl = i => container.querySelectorAll(".call-tree-cell[type=samples]")[i];
 
   is(container.childNodes.length, 1,
     "The container node should have one child available.");
   is(container.childNodes[0].className, "call-tree-item",
     "The root node in the tree has the correct class name.");
 
   is($$dur(0).getAttribute("value"), "18",
     "The root's duration cell displays the correct value.");
   is($$perc(0).getAttribute("value"), "100%",
     "The root's percentage cell displays the correct value.");
-  is($$invoc(0).getAttribute("value"), "",
-    "The root's invocations cell displays the correct value.");
+  is($$sampl(0).getAttribute("value"), "",
+    "The root's samples cell displays the correct value.");
   is($$fun(".call-tree-name")[0].getAttribute("value"), "(root)",
     "The root's function cell displays the correct name.");
   is($$fun(".call-tree-url")[0].getAttribute("value"), "",
     "The root's function cell displays the correct url.");
   is($$fun(".call-tree-line")[0].getAttribute("value"), "",
     "The root's function cell displays the correct line.");
   is($$fun(".call-tree-host")[0].getAttribute("value"), "",
     "The root's function cell displays the correct host.");
@@ -52,18 +52,18 @@ function test() {
     "The root node in the tree has the correct class name.");
   is(container.childNodes[1].className, "call-tree-item",
     "The .A node in the tree has the correct class name.");
 
   is($$dur(1).getAttribute("value"), "18",
     "The .A node's duration cell displays the correct value.");
   is($$perc(1).getAttribute("value"), "100%",
     "The .A node's percentage cell displays the correct value.");
-  is($$invoc(1).getAttribute("value"), "3",
-    "The .A node's invocations cell displays the correct value.");
+  is($$sampl(1).getAttribute("value"), "3",
+    "The .A node's samples cell displays the correct value.");
   is($$fun(".call-tree-name")[1].getAttribute("value"), "A",
     "The .A node's function cell displays the correct name.");
   is($$fun(".call-tree-url")[1].getAttribute("value"), "baz",
     "The .A node's function cell displays the correct url.");
   ok($$fun(".call-tree-url")[1].getAttribute("tooltiptext").contains("http://foo/bar/baz"),
     "The .A node's function cell displays the correct url tooltiptext.");
   is($$fun(".call-tree-line")[1].getAttribute("value"), ":12",
     "The .A node's function cell displays the correct line.");
@@ -81,18 +81,18 @@ function test() {
     "The .B node in the tree has the correct class name.");
   is(container.childNodes[3].className, "call-tree-item",
     "The .E node in the tree has the correct class name.");
 
   is($$dur(2).getAttribute("value"), "11",
     "The .A.B node's duration cell displays the correct value.");
   is($$perc(2).getAttribute("value"), "61.11%",
     "The .A.B node's percentage cell displays the correct value.");
-  is($$invoc(2).getAttribute("value"), "2",
-    "The .A.B node's invocations cell displays the correct value.");
+  is($$sampl(2).getAttribute("value"), "2",
+    "The .A.B node's samples cell displays the correct value.");
   is($$fun(".call-tree-name")[2].getAttribute("value"), "B",
     "The .A.B node's function cell displays the correct name.");
   is($$fun(".call-tree-url")[2].getAttribute("value"), "baz",
     "The .A.B node's function cell displays the correct url.");
   ok($$fun(".call-tree-url")[2].getAttribute("tooltiptext").contains("http://foo/bar/baz"),
     "The .A.B node's function cell displays the correct url tooltiptext.");
   is($$fun(".call-tree-line")[2].getAttribute("value"), ":34",
     "The .A.B node's function cell displays the correct line.");
@@ -100,18 +100,18 @@ function test() {
     "The .A.B node's function cell displays the correct host.");
   is($$fun(".call-tree-category")[2].getAttribute("value"), "Styles",
     "The .A.B node's function cell displays the correct category.");
 
   is($$dur(3).getAttribute("value"), "7",
     "The .A.E node's duration cell displays the correct value.");
   is($$perc(3).getAttribute("value"), "38.88%",
     "The .A.E node's percentage cell displays the correct value.");
-  is($$invoc(3).getAttribute("value"), "1",
-    "The .A.E node's invocations cell displays the correct value.");
+  is($$sampl(3).getAttribute("value"), "1",
+    "The .A.E node's samples cell displays the correct value.");
   is($$fun(".call-tree-name")[3].getAttribute("value"), "E",
     "The .A.E node's function cell displays the correct name.");
   is($$fun(".call-tree-url")[3].getAttribute("value"), "baz",
     "The .A.E node's function cell displays the correct url.");
   ok($$fun(".call-tree-url")[3].getAttribute("tooltiptext").contains("http://foo/bar/baz"),
     "The .A.E node's function cell displays the correct url tooltiptext.");
   is($$fun(".call-tree-line")[3].getAttribute("value"), ":90",
     "The .A.E node's function cell displays the correct line.");
--- a/browser/devtools/profiler/test/browser_profiler_tree-view-04.js
+++ b/browser/devtools/profiler/test/browser_profiler_tree-view-04.js
@@ -43,17 +43,17 @@ function test() {
     "The .A.B.C node's category label cell should not be hidden.");
 
   is(C.target.childNodes.length, 4,
     "The number of columns displayed for tree items is correct.");
   is(C.target.childNodes[0].getAttribute("type"), "duration",
     "The first column displayed for tree items is correct.");
   is(C.target.childNodes[1].getAttribute("type"), "percentage",
     "The second column displayed for tree items is correct.");
-  is(C.target.childNodes[2].getAttribute("type"), "invocations",
+  is(C.target.childNodes[2].getAttribute("type"), "samples",
     "The third column displayed for tree items is correct.");
   is(C.target.childNodes[3].getAttribute("type"), "function",
     "The fourth column displayed for tree items is correct.");
 
   let functionCell = C.target.childNodes[3];
 
   is(functionCell.childNodes.length, 8,
     "The number of columns displayed for function cells is correct.");
--- a/browser/devtools/profiler/utils/tree-model.js
+++ b/browser/devtools/profiler/utils/tree-model.js
@@ -18,27 +18,27 @@ const CONTENT_SCHEMES = ["http://", "htt
 
 exports.ThreadNode = ThreadNode;
 exports.FrameNode = FrameNode;
 exports._isContent = isContent; // used in tests
 
 /**
  * A call tree for a thread. This is essentially a linkage between all frames
  * of all samples into a single tree structure, with additional information
- * on each node, like the time spent (in milliseconds) and invocations count.
+ * on each node, like the time spent (in milliseconds) and samples count.
  *
  * Example:
  * {
  *   duration: number,
  *   calls: {
  *     "FunctionName (url:line)": {
  *       line: number,
  *       category: number,
+ *       samples: number,
  *       duration: number,
- *       invocations: number,
  *       calls: {
  *         ...
  *       }
  *     }, // FrameNode
  *     ...
  *   }
  * } // ThreadNode
  *
@@ -127,18 +127,18 @@ ThreadNode.prototype = {
  * @param number category
  *        The category type of this function call ("js", "graphics" etc.).
  */
 function FrameNode({ location, line, category }) {
   this.location = location;
   this.line = line;
   this.category = category;
   this.sampleTimes = [];
+  this.samples = 0;
   this.duration = 0;
-  this.invocations = 0;
   this.calls = {};
 }
 
 FrameNode.prototype = {
   /**
    * Adds function calls in the tree from a sample's frames. For example, given
    * the the frames below (which would account for three calls to `insert` on
    * the root frame), the following tree structure is created:
@@ -160,18 +160,18 @@ FrameNode.prototype = {
   insert: function(frames, index, time, duration, _store = this.calls) {
     let frame = frames[index];
     if (!frame) {
       return;
     }
     let location = frame.location;
     let child = _store[location] || (_store[location] = new FrameNode(frame));
     child.sampleTimes.push({ start: time, end: time + duration });
+    child.samples++;
     child.duration += duration;
-    child.invocations++;
     child.insert(frames, ++index, time, duration);
   },
 
   /**
    * Parses the raw location of this function call to retrieve the actual
    * function name and source url.
    *
    * @return object
--- a/browser/devtools/profiler/utils/tree-view.js
+++ b/browser/devtools/profiler/utils/tree-view.js
@@ -33,17 +33,17 @@ exports.CallView = CallView;
  *
  * Every instance of a `CallView` represents a row in the call tree. The same
  * parent node is used for all rows.
  *
  * @param CallView caller
  *        The CallView considered the "caller" frame. This instance will be
  *        represent the "callee". Should be null for root nodes.
  * @param ThreadNode | FrameNode frame
- *        Details about this function, like { duration, invocation, calls } etc.
+ *        Details about this function, like { samples, duration, calls } etc.
  * @param number level
  *        The indentation level in the call tree. The root node is at level 0.
  */
 function CallView({ caller, frame, level }) {
   AbstractTreeItem.call(this, { parent: caller, level: level });
 
   this.autoExpandDepth = caller ? caller.autoExpandDepth : CALL_TREE_AUTO_EXPAND;
   this.frame = frame;
@@ -62,34 +62,34 @@ CallView.prototype = Heritage.extend(Abs
   _displaySelf: function(document, arrowNode) {
     this.document = document;
 
     let frameInfo = this.frame.getInfo();
     let framePercentage = this.frame.duration / this.root.frame.duration * 100;
 
     let durationCell = this._createTimeCell(this.frame.duration);
     let percentageCell = this._createExecutionCell(framePercentage);
-    let invocationsCell = this._createInvocationsCell(this.frame.invocations);
+    let samplesCell = this._createSamplesCell(this.frame.samples);
     let functionCell = this._createFunctionCell(arrowNode, frameInfo, this.level);
 
     let targetNode = document.createElement("hbox");
     targetNode.className = "call-tree-item";
     targetNode.setAttribute("origin", frameInfo.isContent ? "content" : "chrome");
     targetNode.setAttribute("category", frameInfo.categoryData.abbrev || "");
     targetNode.setAttribute("tooltiptext", this.frame.location || "");
 
     let isRoot = frameInfo.nodeType == "Thread";
     if (isRoot) {
       functionCell.querySelector(".call-tree-zoom").hidden = true;
       functionCell.querySelector(".call-tree-category").hidden = true;
     }
 
     targetNode.appendChild(durationCell);
     targetNode.appendChild(percentageCell);
-    targetNode.appendChild(invocationsCell);
+    targetNode.appendChild(samplesCell);
     targetNode.appendChild(functionCell);
 
     return targetNode;
   },
 
   /**
    * Populates this node in the call tree with the corresponding "callees".
    * These are defined in the `frame` data source for this call view.
@@ -125,20 +125,20 @@ CallView.prototype = Heritage.extend(Abs
   _createExecutionCell: function(percentage) {
     let cell = this.document.createElement("label");
     cell.className = "plain call-tree-cell";
     cell.setAttribute("type", "percentage");
     cell.setAttribute("crop", "end");
     cell.setAttribute("value", L10N.numberWithDecimals(percentage, 2) + "%");
     return cell;
   },
-  _createInvocationsCell: function(count) {
+  _createSamplesCell: function(count) {
     let cell = this.document.createElement("label");
     cell.className = "plain call-tree-cell";
-    cell.setAttribute("type", "invocations");
+    cell.setAttribute("type", "samples");
     cell.setAttribute("crop", "end");
     cell.setAttribute("value", count || "");
     return cell;
   },
   _createFunctionCell: function(arrowNode, frameInfo, frameLevel) {
     let cell = this.document.createElement("hbox");
     cell.className = "call-tree-cell";
     cell.style.MozMarginStart = (frameLevel * CALL_TREE_INDENTATION) + "px";
--- a/browser/locales/en-US/chrome/browser/devtools/profiler.dtd
+++ b/browser/locales/en-US/chrome/browser/devtools/profiler.dtd
@@ -36,14 +36,14 @@
 <!-- LOCALIZATION NOTE (profilerUI.clearButton): This string is displayed
   -  on a button that remvoes all the recordings. -->
 <!ENTITY profilerUI.clearButton "Clear">
 
 <!-- LOCALIZATION NOTE (profilerUI.table.*): These strings are displayed
   -  in the call tree headers for a recording. -->
 <!ENTITY profilerUI.table.duration    "Time (ms)">
 <!ENTITY profilerUI.table.percentage  "Cost">
-<!ENTITY profilerUI.table.invocations "Calls">
+<!ENTITY profilerUI.table.samples     "Samples">
 <!ENTITY profilerUI.table.function    "Function">
 
 <!-- LOCALIZATION NOTE (profilerUI.newtab.tooltiptext): The tooltiptext shown
   -  on the "+" (new tab) button for a profile when a selection is available. -->
 <!ENTITY profilerUI.newtab.tooltiptext "Add new tab from selection">
--- a/browser/themes/shared/devtools/profiler.inc.css
+++ b/browser/themes/shared/devtools/profiler.inc.css
@@ -255,18 +255,18 @@
   width: 7em;
 }
 
 .call-tree-header[type="percentage"],
 .call-tree-cell[type="percentage"] {
   width: 5em;
 }
 
-.call-tree-header[type="invocations"],
-.call-tree-cell[type="invocations"] {
+.call-tree-header[type="samples"],
+.call-tree-cell[type="samples"] {
   width: 5em;
 }
 
 .call-tree-header[type="function"],
 .call-tree-cell[type="function"] {
   -moz-box-flex: 1;
 }