diff --git a/app/node_views/results.html b/app/node_views/results.html index 2cdb565..3a3b32b 100644 --- a/app/node_views/results.html +++ b/app/node_views/results.html @@ -727,6 +727,8 @@
+ +
Type
diff --git a/app/public/scripts/resultsCtrl.js b/app/public/scripts/resultsCtrl.js index 0ef2288..90cc637 100644 --- a/app/public/scripts/resultsCtrl.js +++ b/app/public/scripts/resultsCtrl.js @@ -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