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> |