Bug 1061759 - Profiler 'calls' columns is improperly named, r=pbrosset

This commit is contained in:
Victor Porof 2014-09-19 08:55:53 -04:00
parent 9e9e65e340
commit 987ced9232
10 changed files with 35 additions and 35 deletions

View File

@ -113,9 +113,9 @@
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"

View File

@ -1,4 +1,4 @@
s/* Any copyright is dedicated to the Public Domain.
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**

View File

@ -130,7 +130,7 @@ function test() {
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.");
@ -139,8 +139,8 @@ function test() {
"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.
@ -151,8 +151,8 @@ function test() {
"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.
@ -163,8 +163,8 @@ function test() {
"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();
}

View File

@ -37,10 +37,10 @@ function test() {
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.");

View File

@ -20,7 +20,7 @@ function test() {
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.");
@ -31,8 +31,8 @@ function test() {
"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"), "",
@ -57,8 +57,8 @@ function test() {
"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",
@ -86,8 +86,8 @@ function test() {
"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",
@ -105,8 +105,8 @@ function test() {
"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",

View File

@ -48,7 +48,7 @@ function test() {
"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.");

View File

@ -23,7 +23,7 @@ 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:
* {
@ -32,8 +32,8 @@ exports._isContent = isContent; // used in tests
* "FunctionName (url:line)": {
* line: number,
* category: number,
* samples: number,
* duration: number,
* invocations: number,
* calls: {
* ...
* }
@ -132,8 +132,8 @@ function FrameNode({ location, line, category }) {
this.line = line;
this.category = category;
this.sampleTimes = [];
this.samples = 0;
this.duration = 0;
this.invocations = 0;
this.calls = {};
}
@ -165,8 +165,8 @@ FrameNode.prototype = {
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);
},

View File

@ -38,7 +38,7 @@ exports.CallView = CallView;
* 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.
*/
@ -67,7 +67,7 @@ CallView.prototype = Heritage.extend(AbstractTreeItem.prototype, {
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");
@ -84,7 +84,7 @@ CallView.prototype = Heritage.extend(AbstractTreeItem.prototype, {
targetNode.appendChild(durationCell);
targetNode.appendChild(percentageCell);
targetNode.appendChild(invocationsCell);
targetNode.appendChild(samplesCell);
targetNode.appendChild(functionCell);
return targetNode;
@ -130,10 +130,10 @@ CallView.prototype = Heritage.extend(AbstractTreeItem.prototype, {
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;

View File

@ -41,7 +41,7 @@
- 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

View File

@ -260,8 +260,8 @@
width: 5em;
}
.call-tree-header[type="invocations"],
.call-tree-cell[type="invocations"] {
.call-tree-header[type="samples"],
.call-tree-cell[type="samples"] {
width: 5em;
}