Skip to content

Commit f49fe20

Browse files
committed
record enhancement time and pageprocessing, both of which ignore the network load time of the jqm js
1 parent dd7a89c commit f49fe20

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

tests/speed/stats/startup.js

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,25 @@
44
Perf.setCurrentRev();
55
Perf.pageLoadStart = Date.now();
66

7+
$( document ).bind( "mobileinit", function() {
8+
Perf.pageProcessingStart = Date.now();
9+
});
10+
711
$listPage.live( "pagebeforecreate", function() {
812
if( firstCounter == 0 ) {
913
Perf.pageCreateStart = Date.now();
1014
firstCounter++;
1115
}
1216
});
1317

18+
$listPage.live( "pagecreate", function( event ) {
19+
if( event.target !== $("#list-page")[0] ){
20+
return;
21+
}
22+
23+
Perf.pageEnhanceStart = Date.now();
24+
});
25+
1426
$listPage.live( "pageinit", function( event ) {
1527
// if a child page init is fired ignore it, we only
1628
// want the top level page init event
@@ -20,12 +32,28 @@
2032

2133
Perf.pageLoadEnd = Date.now();
2234

23-
// report the time taken for a full app boot
35+
// report the time taken for a full app boot includes the time for
36+
// the jquery mobile js to load
2437
Perf.report({
2538
datapoint: "fullboot",
2639
value: Perf.pageLoadEnd - Perf.pageLoadStart
2740
});
2841

42+
// report the time taken for the first page to be enhanced
43+
// pagecreate -> pageinit
44+
Perf.report({
45+
datapoint: "enhancement",
46+
value: Perf.pageLoadEnd - Perf.pageEnhanceStart
47+
});
48+
49+
// report the time taken for the page to process. does *not*
50+
// inclue the load time for js
51+
// mobileinit -> pageinit
52+
Perf.report({
53+
datapoint: "pageprocessing",
54+
value: Perf.pageLoadEnd - Perf.pageProcessingStart
55+
});
56+
2957
// record the time taken to load and enhance the page
3058
// start polling for a new revision
3159
Perf.report({

0 commit comments

Comments
 (0)