| 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,
|
|
|