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

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

Issue 3003163002: Add CsvOutputFormatter to Telemetry. (Closed)
Patch Set: Created 3 years, 4 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
« no previous file with comments | « tracing/tracing/value/csv_builder_test.html ('k') | tracing/tracing/value/histograms_to_csv.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/value/histogram.html
diff --git a/tracing/tracing/value/histogram.html b/tracing/tracing/value/histogram.html
index a3c7f5a68965939737d94b9a97193eba7970f732..362aab0f657dd0518e98dd13f1a65f667526733e 100644
--- a/tracing/tracing/value/histogram.html
+++ b/tracing/tracing/value/histogram.html
@@ -644,20 +644,22 @@ tr.exportTo('tr.v', function() {
*/
getStatisticScalar(statName, opt_referenceHistogram, opt_mwu) {
if (statName === 'avg') {
- if (this.running_ === undefined) return undefined;
+ if (typeof(this.average) !== 'number') return undefined;
return new tr.b.Scalar(this.unit, this.average);
}
if (statName === 'std') {
- if (this.standardDeviation === undefined) return undefined;
+ if (typeof(this.standardDeviation) !== 'number') return undefined;
return new tr.b.Scalar(this.unit, this.standardDeviation);
}
if (statName === 'geometricMean') {
+ if (typeof(this.geometricMean) !== 'number') return undefined;
return new tr.b.Scalar(this.unit, this.geometricMean);
}
if (statName === 'min' || statName === 'max' || statName === 'sum') {
if (this.running_ === undefined) {
this.running_ = new tr.b.math.RunningStatistics();
}
+ if (typeof(this.running_[statName]) !== 'number') return undefined;
return new tr.b.Scalar(this.unit, this.running_[statName]);
}
if (statName === 'nans') {
@@ -672,6 +674,7 @@ tr.exportTo('tr.v', function() {
const percent = percentFromString(statName.substr(4));
if (this.numValues === 0) return undefined;
const percentile = this.getApproximatePercentile(percent);
+ if (typeof(percentile) !== 'number') return undefined;
return new tr.b.Scalar(this.unit, percentile);
}
if (statName.substr(0, 4) === 'ipr_') {
@@ -682,7 +685,9 @@ tr.exportTo('tr.v', function() {
}
lower = this.getApproximatePercentile(lower);
upper = this.getApproximatePercentile(upper);
- return new tr.b.Scalar(this.unit, upper - lower);
+ const ipr = upper - lower;
+ if (typeof(ipr) !== 'number') return undefined;
+ return new tr.b.Scalar(this.unit, ipr);
}
if (!this.canCompare(opt_referenceHistogram)) {
« no previous file with comments | « tracing/tracing/value/csv_builder_test.html ('k') | tracing/tracing/value/histograms_to_csv.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698