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

Unified Diff: tracing/tracing/extras/chrome/estimated_input_latency.html

Issue 2428953002: Helper function for get interactive timestamps (Closed)
Patch Set: Address charliea@ comments Created 4 years, 2 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 | « no previous file | tracing/tracing/extras/chrome/estimated_input_latency_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/extras/chrome/estimated_input_latency.html
diff --git a/tracing/tracing/extras/chrome/estimated_input_latency.html b/tracing/tracing/extras/chrome/estimated_input_latency.html
index 3d5c163475e876ebd303a6e176613fc4122c9a9a..6a2e907ec41a62d664844cad59f7e265eb60f443 100644
--- a/tracing/tracing/extras/chrome/estimated_input_latency.html
+++ b/tracing/tracing/extras/chrome/estimated_input_latency.html
@@ -5,6 +5,9 @@ Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
+<link rel="import" href="/tracing/metrics/system_health/loading_metric.html">
+<link rel="import" href="/tracing/value/value_set.html">
+
<script>
'use strict';
tr.exportTo('tr.e.chrome', function() {
@@ -30,6 +33,32 @@ tr.exportTo('tr.e.chrome', function() {
}
/**
+ * Returns a map of renderer PIDs to array of timestamps at which the
+ * renderer became interactive.
+ */
+ function getInteractiveTimestamps(model) {
+ // TODO(dproy): When LoadExpectation v.1.0 is released,
+ // update this function to use the new LoadExpectation rather
+ // than calling loading_metric.html.
+
+ var values = new tr.v.ValueSet();
+ tr.metrics.sh.loadingMetric(values, model);
+ var ttiValues = values.getValuesNamed('timeToFirstInteractive');
+ var interactiveTimestampsMap = new Map();
+ for (var bin of tr.b.getOnlyElement(ttiValues).allBins) {
+ for (var diagnostics of bin.diagnosticMaps) {
+ var value = diagnostics.get('Navigation infos').value;
+ var pid = value.pid;
+ var interactiveTimestampsForProcess =
+ interactiveTimestampsMap.get(pid) || [];
+ interactiveTimestampsForProcess.push(value.interactive);
+ interactiveTimestampsMap.set(pid, interactiveTimestampsForProcess);
+ }
+ }
+ return interactiveTimestampsMap;
+ }
+
+ /**
* Returns an Array of task windows that start with the supplied interactive
* timestamps.
*
@@ -85,7 +114,8 @@ tr.exportTo('tr.e.chrome', function() {
return {
getPostInteractiveTaskWindows: getPostInteractiveTaskWindows,
- getNavStartTimestamps: getNavStartTimestamps
+ getNavStartTimestamps: getNavStartTimestamps,
+ getInteractiveTimestamps: getInteractiveTimestamps
};
});
</script>
« no previous file with comments | « no previous file | tracing/tracing/extras/chrome/estimated_input_latency_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698