Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Unified Diff: tracing/tracing/value/numeric.html

Issue 2101233003: Revert of Change Numeric sourceInfos into sample diagnostics (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tracing/tracing/value/numeric.html
diff --git a/tracing/tracing/value/numeric.html b/tracing/tracing/value/numeric.html
index 464026dd5867e63773a2665bc23d85f731607dee..f8fc53f890a6ecd424619850dbcc716a1a47cc0a 100644
--- a/tracing/tracing/value/numeric.html
+++ b/tracing/tracing/value/numeric.html
@@ -18,7 +18,7 @@
tr.exportTo('tr.v', function() {
var Range = tr.b.Range;
- var MAX_DIAGNOSTICS = 16;
+ var MAX_SOURCE_INFOS = 16;
function NumericBase(unit) {
if (!(unit instanceof tr.v.Unit))
@@ -52,7 +52,7 @@
this.parentNumeric = parentNumeric;
this.range = opt_range || (new tr.b.Range());
this.count = 0;
- this.diagnostics = [];
+ this.sourceInfos = [];
}
NumericBin.fromDict = function(parentNumeric, d) {
@@ -60,29 +60,22 @@
n.range.min = d.min;
n.range.max = d.max;
n.count = d.count;
- if (d.diagnostics)
- n.diagnostics = d.diagnostics.map(dd => tr.v.d.Diagnostic.fromDict(dd));
+ n.sourceInfos = d.sourceInfos;
return n;
};
NumericBin.prototype = {
- /**
- * @param {*} value
- * @param {!tr.v.d.Diagnostic=} opt_diagnostic
- */
- add: function(value, opt_diagnostic) {
+ add: function(value, sourceInfo) {
this.count += 1;
- if (opt_diagnostic) {
- tr.b.Statistics.uniformlySampleStream(
- this.diagnostics, this.count, opt_diagnostic, MAX_DIAGNOSTICS);
- }
+ tr.b.Statistics.uniformlySampleStream(this.sourceInfos, this.count,
+ sourceInfo, MAX_SOURCE_INFOS);
},
addBin: function(other) {
if (!this.range.equals(other.range))
throw new Error('Merging incompatible Numeric bins.');
- tr.b.Statistics.mergeSampledStreams(this.diagnostics, this.count,
- other.diagnostics, other.count, MAX_DIAGNOSTICS);
+ tr.b.Statistics.mergeSampledStreams(this.sourceInfos, this.count,
+ other.sourceInfos, other.count, MAX_SOURCE_INFOS);
this.count += other.count;
},
@@ -91,7 +84,7 @@
min: this.range.min,
max: this.range.max,
count: this.count,
- diagnostics: this.diagnostics.map(d => d.asDict())
+ sourceInfos: this.sourceInfos.slice(0)
};
},
@@ -106,7 +99,7 @@
this.range = range;
this.numNans = 0;
- this.nanDiagnostics = [];
+ this.nanSourceInfos = [];
this.running = new tr.b.RunningStatistics();
this.maxCount_ = 0;
@@ -145,10 +138,7 @@
if (d.summaryOptions)
n.customizeSummaryOptions(d.summaryOptions);
n.numNans = d.numNans;
- if (d.nanDiagnostics) {
- n.nanDiagnostics = d.nanDiagnostics.map(
- dd => tr.v.d.Diagnostic.fromDict(dd));
- }
+ n.nanSourceInfos = d.nanSourceInfos;
return n;
};
@@ -265,20 +255,16 @@
return this.allBins[binIndex] || this.overflowBin;
},
- /**
- * @param {*} value
- * @param {!tr.v.d.Diagnostic=} opt_diagnostic
- */
- add: function(value, opt_diagnostic) {
+ add: function(value, sourceInfo) {
if (typeof(value) !== 'number' || isNaN(value)) {
this.numNans++;
- tr.b.Statistics.uniformlySampleStream(this.nanDiagnostics, this.numNans,
- opt_diagnostic, MAX_DIAGNOSTICS);
+ tr.b.Statistics.uniformlySampleStream(this.nanSourceInfos, this.numNans,
+ sourceInfo, MAX_SOURCE_INFOS);
return;
}
var bin = this.getBinForValue(value);
- bin.add(value, opt_diagnostic);
+ bin.add(value, sourceInfo);
this.running.add(value);
if (bin.count > this.maxCount_)
this.maxCount_ = bin.count;
@@ -290,8 +276,8 @@
this.allBins.length !== other.allBins.length) {
throw new Error('Merging incompatible Numerics.');
}
- tr.b.Statistics.mergeSampledStreams(this.nanDiagnostics, this.numNans,
- other.nanDiagnostics, other.numNans, MAX_DIAGNOSTICS);
+ tr.b.Statistics.mergeSampledStreams(this.nanSourceInfos, this.numNans,
+ other.nanSourceInfos, other.numNans, MAX_SOURCE_INFOS);
this.numNans += other.numNans;
this.running = this.running.merge(other.running);
for (var i = 0; i < this.allBins.length; ++i) {
@@ -408,7 +394,7 @@
max: this.range.max,
numNans: this.numNans,
- nanDiagnostics: this.nanDiagnostics.map(d => d.asDict()),
+ nanSourceInfos: this.nanSourceInfos,
running: this.running.asDict(),
summaryOptions: this.summaryOptions,
« no previous file with comments | « tracing/tracing/metrics/system_health/responsiveness_metric.html ('k') | tracing/tracing/value/numeric_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698