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

Side by Side Diff: tracing/tracing/metrics/compare_samples_cmdline.html

Issue 2771723003: [tracing] Move math utilities from base into their own subdirectory (attempt 2) (Closed)
Patch Set: rebase Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright 2016 The Chromium Authors. All rights reserved. 3 Copyright 2016 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 7
8 <link rel="import" href="/tracing/base/iteration_helpers.html"> 8 <link rel="import" href="/tracing/base/iteration_helpers.html">
9 <link rel="import" href="/tracing/base/statistics.html"> 9 <link rel="import" href="/tracing/base/math/statistics.html">
10 <link rel="import" href="/tracing/base/xhr.html"> 10 <link rel="import" href="/tracing/base/xhr.html">
11 <link rel="import" href="/tracing/value/histogram_set.html"> 11 <link rel="import" href="/tracing/value/histogram_set.html">
12 12
13 <script> 13 <script>
14 'use strict'; 14 'use strict';
15 /* eslint-disable no-console */ 15 /* eslint-disable no-console */
16 16
17 var escapeChars = s => s.replace(/[\:|=\/#&,]/g, '_'); 17 var escapeChars = s => s.replace(/[\:|=\/#&,]/g, '_');
18 18
19 function findUnescapedKey(escaped, d) { 19 function findUnescapedKey(escaped, d) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 for (var charts of listOfCharts) { 77 for (var charts of listOfCharts) {
78 var chartName = findUnescapedKey(chartAndTrace[0], charts.charts); 78 var chartName = findUnescapedKey(chartAndTrace[0], charts.charts);
79 if (chartName) { 79 if (chartName) {
80 var traceName = findUnescapedKey( 80 var traceName = findUnescapedKey(
81 chartAndTrace[1], charts.charts[chartName]); 81 chartAndTrace[1], charts.charts[chartName]);
82 if (traceName) { 82 if (traceName) {
83 if (charts.charts[chartName][traceName].type === 83 if (charts.charts[chartName][traceName].type ===
84 'list_of_scalar_values') { 84 'list_of_scalar_values') {
85 if (charts.charts[chartName][traceName].values === null) 85 if (charts.charts[chartName][traceName].values === null)
86 continue; 86 continue;
87 allValues.push(tr.b.Statistics.mean( 87 allValues.push(tr.b.math.Statistics.mean(
88 charts.charts[chartName][traceName].values)); 88 charts.charts[chartName][traceName].values));
89 } 89 }
90 if (charts.charts[chartName][traceName].type === 'histogram') 90 if (charts.charts[chartName][traceName].type === 'histogram')
91 allValues.push( 91 allValues.push(
92 geoMeanFromHistogram(charts.charts[chartName][traceName])); 92 geoMeanFromHistogram(charts.charts[chartName][traceName]));
93 if (charts.charts[chartName][traceName].type === 'scalar') 93 if (charts.charts[chartName][traceName].type === 'scalar')
94 allValues.push(charts.charts[chartName][traceName].value); 94 allValues.push(charts.charts[chartName][traceName].value);
95 } 95 }
96 } 96 }
97 } 97 }
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 throw err; 220 throw err;
221 } 221 }
222 allValues = allValues.concat(valuesFromBuildbotOutput(contents, metric)); 222 allValues = allValues.concat(valuesFromBuildbotOutput(contents, metric));
223 } 223 }
224 return allValues; 224 return allValues;
225 } 225 }
226 226
227 var buildComparisonResultOutput = function(a, b) { 227 var buildComparisonResultOutput = function(a, b) {
228 if (!a.length || !b.length) { 228 if (!a.length || !b.length) {
229 var comparisonResult = { 229 var comparisonResult = {
230 significance: tr.b.Statistics.Significance.NEED_MORE_DATA 230 significance: tr.b.math.Statistics.Significance.NEED_MORE_DATA
231 }; 231 };
232 } else { 232 } else {
233 var comparisonResult = tr.b.Statistics.mwu( 233 var comparisonResult = tr.b.math.Statistics.mwu(
234 a, b, tr.b.Statistics.DEFAULT_ALPHA, 234 a, b, tr.b.math.Statistics.DEFAULT_ALPHA,
235 tr.b.Statistics.MAX_SUGGESTED_SAMPLE_SIZE); 235 tr.b.math.Statistics.MAX_SUGGESTED_SAMPLE_SIZE);
236 } 236 }
237 return { 237 return {
238 sampleA: a, 238 sampleA: a,
239 sampleB: b, 239 sampleB: b,
240 result: comparisonResult 240 result: comparisonResult
241 }; 241 };
242 }; 242 };
243 243
244 var SampleComparison = { 244 var SampleComparison = {
245 245
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 }; 282 };
283 283
284 if (tr.isHeadless) { 284 if (tr.isHeadless) {
285 var method; 285 var method;
286 var rest; 286 var rest;
287 [method, ...rest] = sys.argv.slice(1); 287 [method, ...rest] = sys.argv.slice(1);
288 if (SampleComparison[method]) 288 if (SampleComparison[method])
289 console.log(JSON.stringify(SampleComparison[method](...rest))); 289 console.log(JSON.stringify(SampleComparison[method](...rest)));
290 } 290 }
291 </script> 291 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/metrics/blink/gc_metric.html ('k') | tracing/tracing/metrics/sample_metric.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698