Even more precise positionning of navigation timings in timeline
This commit is contained in:
@@ -840,16 +840,7 @@
|
||||
<span ng-if="node.data.time > slowRequestsLimit" class="icon-warning" title="Slower than {{slowRequestsLimit}} ms"></span>
|
||||
</div>
|
||||
<div class="duration" ng-if="node.data.time == undefined"></div>
|
||||
<div class="startTime" ng-class="{
|
||||
domCreation: node.data.timestamp < phantomasResults.metrics.domInteractive,
|
||||
domInteractive: node.data.timestamp >= phantomasResults.metrics.domInteractive
|
||||
&& node.data.timestamp < phantomasResults.metrics.domContentLoaded,
|
||||
domContentLoaded: node.data.timestamp >= phantomasResults.metrics.domContentLoaded
|
||||
&& node.data.timestamp < phantomasResults.metrics.domContentLoadedEnd,
|
||||
domContentLoadedEnd: node.data.timestamp >= phantomasResults.metrics.domContentLoadedEnd
|
||||
&& node.data.timestamp < phantomasResults.metrics.domComplete,
|
||||
domComplete: node.data.timestamp >= phantomasResults.metrics.domComplete
|
||||
}">{{node.data.timestamp | number: 0}}</div>
|
||||
<div class="startTime" ng-class="node.data.loadingStep">{{node.data.timestamp | number: 0}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -99,6 +99,7 @@ exports.module = function(phantomas) {
|
||||
function pushContext(data) {
|
||||
if (depth === 0 || deepAnalysis) {
|
||||
data.timestamp = Date.now() - responseEndTime;
|
||||
data.loadingStep = phantomas.currentStep || '';
|
||||
currentContext.addChild(data);
|
||||
}
|
||||
}
|
||||
@@ -107,6 +108,7 @@ exports.module = function(phantomas) {
|
||||
function enterContext(data) {
|
||||
if (depth === 0 || deepAnalysis) {
|
||||
data.timestamp = Date.now() - responseEndTime;
|
||||
data.loadingStep = phantomas.currentStep || '';
|
||||
currentContext = currentContext.addChild(data);
|
||||
}
|
||||
depth ++;
|
||||
|
||||
@@ -34,6 +34,8 @@ exports.module = function(phantomas) {
|
||||
(function(phantomas) {
|
||||
phantomas.spyEnabled(false, 'installing window.performance metrics');
|
||||
|
||||
phantomas.currentStep = 'domCreation';
|
||||
|
||||
// extend window.performance
|
||||
// "init" event is sometimes fired twice, pass a value set by "responseEnd" event handler (fixes #192)
|
||||
if (typeof window.performance === 'undefined') {
|
||||
@@ -59,6 +61,7 @@ exports.module = function(phantomas) {
|
||||
:
|
||||
(Date.now() - responseEndTime);
|
||||
|
||||
phantomas.currentStep = 'domContentLoadedEnd';
|
||||
phantomas.setMetric('domContentLoadedEnd', time, true);
|
||||
phantomas.log('Performance timing: document reached "DOMContentLoadedEnd" state after %d ms', time);
|
||||
|
||||
@@ -72,6 +75,7 @@ exports.module = function(phantomas) {
|
||||
|
||||
var time = Date.now() - responseEndTime;
|
||||
|
||||
phantomas.currentStep = 'domContentLoaded';
|
||||
phantomas.setMetric('domContentLoaded', time, true);
|
||||
phantomas.log('Performance timing: document reached "DOMContentLoaded" state after %d ms', time);
|
||||
|
||||
@@ -105,6 +109,7 @@ exports.module = function(phantomas) {
|
||||
return;
|
||||
}
|
||||
|
||||
phantomas.currentStep = metricName;
|
||||
phantomas.setMetric(metricName, time, true);
|
||||
phantomas.log('Performance timing: document reached "%s" state after %d ms', readyState, time);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user