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

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

Issue 2133963002: Implement Composition.buildFromEvents() (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: fix composition-span Created 4 years, 5 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/metrics/system_health/long_tasks_metric.html
diff --git a/tracing/tracing/metrics/system_health/long_tasks_metric.html b/tracing/tracing/metrics/system_health/long_tasks_metric.html
index 77a8c77a0d8de509e5a679329cd5096881ba5f7f..b67ccd00e7b35067eaa58b89bbb3b9235dd23111 100644
--- a/tracing/tracing/metrics/system_health/long_tasks_metric.html
+++ b/tracing/tracing/metrics/system_health/long_tasks_metric.html
@@ -5,6 +5,8 @@ Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
+<link rel="import"
eakuefner 2016/07/12 16:18:48 nit: there isn't an 80char limit in HTML, so just
+ href="/tracing/extras/chrome/chrome_user_friendly_category_driver.html">
<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/numeric.html">
@@ -68,6 +70,9 @@ tr.exportTo('tr.metrics.sh', function() {
var LONG_TASK_NUMERIC_BUILDER = tr.v.NumericBuilder.createLinear(
tr.v.Unit.byName.timeDurationInMs_smallerIsBetter,
tr.b.Range.fromExplicitRange(LONG_TASK_MS, LONGEST_TASK_MS), 50);
+ var SLICE_NUMERIC_BUILDER = tr.v.NumericBuilder.createExponential(
eakuefner 2016/07/12 16:18:48 Why exponential? Comment perhaps?
+ tr.v.Unit.byName.timeDurationInMs_smallerIsBetter,
+ tr.b.Range.fromExplicitRange(0.1, LONGEST_TASK_MS), 50);
/**
* This metric directly measures long tasks on renderer main threads.
@@ -80,16 +85,24 @@ tr.exportTo('tr.metrics.sh', function() {
function longTasksMetric(values, model, opt_options) {
var rangeOfInterest = opt_options ? opt_options.rangeOfInterest : undefined;
var longTaskNumeric = LONG_TASK_NUMERIC_BUILDER.build();
+ var slices = new tr.model.EventSet();
iterateRendererMainThreads(model, function(thread) {
iterateLongTopLevelTasksOnThreadInRange(
thread, rangeOfInterest, function(task) {
longTaskNumeric.add(task.duration,
new tr.v.d.RelatedEventSet([task]));
+ slices.push(task);
+ slices.addEventSet(task.descendentSlices);
});
});
var options = {description: 'durations of long tasks'};
- values.addValue(new tr.v.NumericValue(
- 'long tasks', longTaskNumeric, options));
+ var longTaskValue = new tr.v.NumericValue(
+ 'long tasks', longTaskNumeric, options);
+ values.addValue(longTaskValue);
+ var composition = tr.v.d.Composition.build(
+ values, 'long tasks ', slices, SLICE_NUMERIC_BUILDER,
+ tr.e.chrome.ChromeUserFriendlyCategoryDriver.fromEvent);
+ longTaskValue.diagnostics.add('category', composition);
}
tr.metrics.MetricRegistry.register(longTasksMetric, {

Powered by Google App Engine
This is Rietveld 408576698