Better navigation timings precision in JS timeline

This commit is contained in:
Gaël Métais
2014-10-23 14:23:44 +02:00
parent 10cdd9cda4
commit 130ae7d3f8
2 changed files with 27 additions and 2 deletions
+2
View File
@@ -727,6 +727,8 @@
</div>
</div>
<div class="table">
<toto data-info="mavariable"></toto>
<div class="headers">
<div><!-- index --></div>
<div>Type</div>
+25 -2
View File
@@ -17,7 +17,7 @@ app.controller('ResultsCtrl', function ($scope) {
initSummaryView();
initExecutionView();
initJSTimelineView();
initMetricsView();
}
@@ -89,7 +89,7 @@ app.controller('ResultsCtrl', function ($scope) {
};
}
function initExecutionView() {
function initJSTimelineView() {
$scope.slowRequestsOn = false;
$scope.slowRequestsLimit = 5;
@@ -97,6 +97,29 @@ app.controller('ResultsCtrl', function ($scope) {
return;
}
// Read the execution tree and adjust the navigation timings (cause their not very well synchronised)
treeRunner($scope.javascript, function(node) {
switch(node.data.type) {
case 'domInteractive':
$scope.phantomasResults.metrics.domInteractive = node.data.timestamp;
break;
case 'domContentLoaded':
$scope.phantomasResults.metrics.domContentLoaded = node.data.timestamp;
break;
case 'domContentLoadedEnd':
$scope.phantomasResults.metrics.domContentLoadedEnd = node.data.timestamp;
break;
case 'domComplete':
$scope.phantomasResults.metrics.domComplete = node.data.timestamp;
break;
}
if (node.data.type !== 'main') {
// Don't check the children
return false;
}
});
// Now read the tree and display it on a timeline