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

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

Issue 2428953002: Helper function for get interactive timestamps (Closed)
Patch Set: 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..768734e16aec57c96a6b9535dde959515d5f66e2 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() {
@@ -29,6 +32,24 @@ tr.exportTo('tr.e.chrome', function() {
return navStartTimestamps;
}
+ 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 interactiveTimestamps = [];
+ for (var bin of tr.b.getOnlyElement(ttiValues).allBins) {
+ for (var diagnostics of bin.diagnosticMaps) {
+ var info = diagnostics.get('Navigation infos');
+ interactiveTimestamps.push(info.value.interactive);
+ }
+ }
+ return interactiveTimestamps;
nednguyen 2016/10/18 19:56:11 Hmhh, this is a flatten list, which will not work
dproy 2016/10/18 20:44:59 You're right. Fixed in latest patch.
+ }
+
/**
* Returns an Array of task windows that start with the supplied interactive
* timestamps.
@@ -85,7 +106,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