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

Unified Diff: tracing/tracing/metrics/system_health/cpu_time_metric.html

Issue 2446423009: Normalize thread_times metric against the bounds of the browser process. (Closed)
Patch Set: Comments from nednguyen. Created 4 years, 1 month 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 | « no previous file | tracing/tracing/metrics/system_health/cpu_time_metric_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/metrics/system_health/cpu_time_metric.html
diff --git a/tracing/tracing/metrics/system_health/cpu_time_metric.html b/tracing/tracing/metrics/system_health/cpu_time_metric.html
index 8e38f9363442632f1f80cccd1ae04aa61e5fd13f..259d4af8bb276d16e0ccec17e99c98cdc63030f8 100644
--- a/tracing/tracing/metrics/system_health/cpu_time_metric.html
+++ b/tracing/tracing/metrics/system_health/cpu_time_metric.html
@@ -6,6 +6,7 @@ found in the LICENSE file.
-->
<link rel="import" href="/tracing/metrics/metric_registry.html">
+<link rel="import" href="/tracing/model/helpers/chrome_model_helper.html">
<link rel="import" href="/tracing/value/histogram.html">
<script>
@@ -30,8 +31,23 @@ tr.exportTo('tr.metrics.sh', function() {
*/
function cpuTimeMetric(values, model, opt_options) {
var rangeOfInterest = model.bounds;
- if (opt_options && opt_options.rangeOfInterest)
+
+ if (opt_options && opt_options.rangeOfInterest) {
rangeOfInterest = opt_options.rangeOfInterest;
+ } else {
+ // If no range of interest is provided, limit the relevant range to
+ // Chrome processes. This prevents us from normalizing against non-Chrome
+ // related slices in the trace.
+ var chromeHelper = model.getOrCreateHelper(
+ tr.model.helpers.ChromeModelHelper);
+ if (chromeHelper) {
+ var chromeBounds = chromeHelper.chromeBounds;
+ if (chromeBounds) {
+ rangeOfInterest = chromeBounds;
+ }
+ }
+ }
+
var allProcessCpuTime = 0;
for (var pid in model.processes) {
« no previous file with comments | « no previous file | tracing/tracing/metrics/system_health/cpu_time_metric_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698