From 66525fd36530ffbda7d1bfdd224fa5284e171c86 Mon Sep 17 00:00:00 2001 From: soulgalore Date: Wed, 20 Nov 2013 21:44:51 +0100 Subject: [PATCH 1/8] added requests without GZip on summary pages closes #310 --- CHANGELOG | 4 ++ bin/sitespeed.io | 2 +- .../velocity/logic/site.summary.xml.logic.vm | 47 +++++++++++-------- 3 files changed, 33 insertions(+), 20 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1cec5553d..64fc86ca0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ CHANGELOG sitespeed.io +version 2.3-wip +------------------------ +* Added the number of text assets that are missing GZIP on the summary page (xml) #310 + version 2.2.2 ------------------------ * Bug fix: User marks named with spaces broke the summary.xml diff --git a/bin/sitespeed.io b/bin/sitespeed.io index 455a94333..2638c27c2 100755 --- a/bin/sitespeed.io +++ b/bin/sitespeed.io @@ -284,7 +284,7 @@ if [ "$SUMMARY_BOXES" != "" ] SUMMARY_BOXES="-Dcom.soulgalore.velocity.key.boxes=$SUMMARY_BOXES" else # Default columns - SUMMARY_BOXES="-Dcom.soulgalore.velocity.key.boxes=ruleScore,criticalPathScore,jsSyncInHead,jsPerPage,cssPerPage,cssImagesPerPage,imagesPerPage,requests,requestsWithoutExpires,pageWeight,docWeight,imageWeightPerPage,browserScaledImages,spofPerPage,domainsPerPage,domElements,assetsCacheTime,timeSinceLastModification" + SUMMARY_BOXES="-Dcom.soulgalore.velocity.key.boxes=ruleScore,criticalPathScore,jsSyncInHead,jsPerPage,cssPerPage,cssImagesPerPage,imagesPerPage,requests,requestsWithoutExpires,requestsWithoutGZipPerPage,pageWeight,docWeight,imageWeightPerPage,browserScaledImages,spofPerPage,domainsPerPage,domElements,assetsCacheTime,timeSinceLastModification" if $COLLECT_BROWSER_TIMINGS then SUMMARY_BOXES="$SUMMARY_BOXES",serverResponseTime,backEndTime,pageDownloadTime,frontEndTime,domContentLoadedTime,pageLoadTime diff --git a/report/velocity/logic/site.summary.xml.logic.vm b/report/velocity/logic/site.summary.xml.logic.vm index 9fe5259de..0a93df319 100644 --- a/report/velocity/logic/site.summary.xml.logic.vm +++ b/report/velocity/logic/site.summary.xml.logic.vm @@ -3,7 +3,7 @@ #set($nrOfPages = $document.getRootElement().getChildren("results").size()) ## Get the total objects - + #set($nrOfDecimals = 0) ## Creating all statistics objects @@ -32,6 +32,7 @@ #set($statsAssetCacheTimeInSeconds = $stats.newInstance("assetsCacheTime","Cache time","","cachetime","",1)) #set($statsDomElements = $stats.newInstance("domElements","Number of DOM elements","","","",1)) #set($statsDomains = $stats.newInstance("domainsPerPage","Number of domains","","","",1)) +#set($statsCompressed = $stats.newInstance("requestsWithoutGZipPerPage","Requests without GZip","","","",1)) ## And add them to the list of statistics #set($hide = $allStats.add($statsScore)) @@ -59,15 +60,15 @@ #set($hide = $allStats.add($statsAssetCacheTimeInSeconds)) #set($hide = $allStats.add($statsDomains)) #set($hide = $allStats.add($statsScaledImages)) - +#set($hide = $allStats.add($statsCompressed)) ## Fetch all statistics used by the boxes #foreach ($results in $document.getRootElement().getChildren()) #if($!{results.getChild("stats").getChild("js").getChild("r")}) $statsJs.addValue($math.toInteger($results.getChild("stats").getChild("js").getChild("r").getValue())) - #end - + #end + #if($!{results.getChild("stats").getChild("css").getChild("r")}) $statsCss.addValue($math.toInteger($results.getChild("stats").getChild("css").getChild("r").getValue())) #end @@ -83,7 +84,7 @@ #if($!{results.getChild("r")}) $statsRequests.addValue($math.toInteger($results.getChild("r").getValue())) #end - + #if($!{results.getChild("w")}) ## sometimes the page weight is wrongly calculated by YSlow, so lets do it manually #set($totalWeight = 0) @@ -99,7 +100,7 @@ #end #if($!{results.getChild("stats").getChild("doc").getChild("w")}) - + $statsDocumentWeight.addValue($math.toDouble($math.roundTo(3,$math.div($results.getAttribute("size").getValue(),1000)))) #end @@ -113,8 +114,16 @@ $statsSpofPages.addValue(1) $statsSpof.addValue($math.toInteger($results.getChild("g").getChild("spof").getChild("components").getChildren("item").size())) #else - $statsSpof.addValue(0) - #end + $statsSpof.addValue(0) + #end + #end + + #if($!{results.getChild("g").getChild("ycompress").getChild("score")}) + #if ($results.getChild("g").getChild("ycompress").getChild("score").getValue() != 100) + $statsCompressed.addValue($math.toInteger($results.getChild("g").getChild("ycompress").getChild("components").getChildren("item").size())) + #else + $statsCompressed.addValue(0) + #end #end @@ -153,34 +162,34 @@ #set ($date = "") #set ($cacheControl = 0) #set ($expires = "") - + ## fetch the real ones #set ($lastMod = $asset.getChild("headers").getChild("response").getChild("Last-Modified").getValue()) #set ($date = $asset.getChild("headers").getChild("response").getChild("Date").getValue()) #set ($cacheControl = $asset.getChild("headers").getChild("response").getChild("Cache-Control").getValue()) #set ($expires = $asset.getChild("headers").getChild("response").getChild("Expires").getValue()) - + #set ($delta = $header.getDelta($lastMod,$date)) #if ($delta=="" || ! $delta) ## unknown skip it for now #else $statsTimeSinceLastModificationInSeconds.addValue($delta.getSeconds()) - #end - + #end + #set ($cacheTime = $header.getCacheTime($cacheControl, $expires, $date)) #if ($cacheTime=="" || !$cacheTime) $statsAssetCacheTimeInSeconds.addValue(0) - #else + #else $statsAssetCacheTimeInSeconds.addValue($cacheTime.getSeconds()) #end #if (($asset.getChild("type").getValue() == "image") || ($asset.getChild("type").getValue() == "cssimage")) $statsImageWeight.addValue($math.toDouble($math.roundTo(3,$math.div($asset.getChild("size").getValue(),1000)))) #set($totalImagePageSize = $math.add($totalImagePageSize,$math.toDouble($math.roundTo(3,$math.div($asset.getChild("size").getValue(),1000))))) - #elseif ($asset.getChild("type").getValue() == "css") + #elseif ($asset.getChild("type").getValue() == "css") $statsCssWeight.addValue($math.toDouble($math.roundTo(3,$math.div($asset.getChild("size").getValue(),1000)))) #set($totalCssPageSize = $math.add($totalCssPageSize,$math.toDouble($math.roundTo(3,$math.div($asset.getChild("size").getValue(),1000))))) - #elseif ($asset.getChild("type").getValue() == "js") + #elseif ($asset.getChild("type").getValue() == "js") $statsJsWeight.addValue($math.toDouble($math.roundTo(3,$math.div($asset.getChild("size").getValue(),1000)))) #set($totalJsPageSize = $math.add($totalJsPageSize,$math.toDouble($math.roundTo(3,$math.div($asset.getChild("size").getValue(),1000))))) #end @@ -190,7 +199,7 @@ #if (!$hosts.contains($theHost)) #set($swallow = $hosts.add($theHost)) #end - + #end #if($hosts.size()>0) @@ -206,7 +215,7 @@ #if($totalJsPageSize>0) $statsTotalJsWeight.addValue($totalJsPageSize) #end - + #end ## We create only these extra data if (and only if) we also run Browser Time to collect them @@ -239,9 +248,9 @@ ## Include a custom logic file, if you want to include your own code. #if ($filetool.doFileExist("report/velocity/logic/custom/site.summary.xml.logic.vm")) #parse("report/velocity/logic/custom/site.summary.xml.logic.vm") -#end +#end + - \ No newline at end of file From 5c3ac805e4d56a40cb4b3462c907d102c17b0f11 Mon Sep 17 00:00:00 2001 From: soulgalore Date: Thu, 21 Nov 2013 08:12:09 +0100 Subject: [PATCH 2/8] added firstpaint & gzip --- dependencies/rules-desktop.properties | 5 +++++ dependencies/rules-mobile.properties | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dependencies/rules-desktop.properties b/dependencies/rules-desktop.properties index a8fff0f1e..b702933f9 100644 --- a/dependencies/rules-desktop.properties +++ b/dependencies/rules-desktop.properties @@ -51,5 +51,10 @@ domContentLoadedTime=LESS_THAN;500;700 backEndTime=LESS_THAN;400;600 # frontEndTime frontEndTime=LESS_THAN;300;400 +# Time to first paint +firstPaintTime=LESS_THAN;500;700 +# Gzip requests +requestsWithoutGZipPerPage=LESS_THAN;1.0;1.0 + # Cache time (in seconds) #assetsCacheTime=GREATER_THAN;31556925;2592000 \ No newline at end of file diff --git a/dependencies/rules-mobile.properties b/dependencies/rules-mobile.properties index 00642b6ec..a0c4daf5b 100644 --- a/dependencies/rules-mobile.properties +++ b/dependencies/rules-mobile.properties @@ -45,4 +45,7 @@ pageDownloadTime=LESS_THAN;20;40 domInteractiveTime=LESS_THAN;500;600 domContentLoadedTime=LESS_THAN;500;600 backEndTime=LESS_THAN;400;600 -frontEndTime=LESS_THAN;300;400 \ No newline at end of file +frontEndTime=LESS_THAN;300;400 +firstPaintTime=LESS_THAN;500;600 +# Gzip requests +requestsWithoutGZipPerPage=LESS_THAN;1.0;1.0 \ No newline at end of file From 80d2b3282dffb3a5e1a3d9e42c0b36972d90838f Mon Sep 17 00:00:00 2001 From: soulgalore Date: Thu, 21 Nov 2013 10:22:12 +0100 Subject: [PATCH 3/8] cleanup --- dependencies/rules-desktop.properties | 7 ++----- dependencies/rules-mobile.properties | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/dependencies/rules-desktop.properties b/dependencies/rules-desktop.properties index b702933f9..b35c09fe1 100644 --- a/dependencies/rules-desktop.properties +++ b/dependencies/rules-desktop.properties @@ -31,6 +31,8 @@ criticalPathScore=GREATER_THAN;99;95 requestsWithoutExpires=LESS_THAN;1;5 ## The amount of text content on a page in percentage textContent=GREATER_THAN;49;25 +# Gzip requests +requestsWithoutGZipPerPage=LESS_THAN;1.0;1.0 ## The server response time serverResponseTime=LESS_THAN;300;500 ## The number of DOM elements @@ -53,8 +55,3 @@ backEndTime=LESS_THAN;400;600 frontEndTime=LESS_THAN;300;400 # Time to first paint firstPaintTime=LESS_THAN;500;700 -# Gzip requests -requestsWithoutGZipPerPage=LESS_THAN;1.0;1.0 - -# Cache time (in seconds) -#assetsCacheTime=GREATER_THAN;31556925;2592000 \ No newline at end of file diff --git a/dependencies/rules-mobile.properties b/dependencies/rules-mobile.properties index a0c4daf5b..1b8f209c8 100644 --- a/dependencies/rules-mobile.properties +++ b/dependencies/rules-mobile.properties @@ -39,6 +39,8 @@ domElements=LESS_THAN;901;1008 domainsPerPage=LESS_THAN;3;7 ## The number of browser scaled images browserScaledImages=LESS_THAN;1;2 +# Gzip requests +requestsWithoutGZipPerPage=LESS_THAN;1.0;1.0 ## Redirection time redirectionTime=LESS_THAN;1.0;1.0 pageDownloadTime=LESS_THAN;20;40 @@ -47,5 +49,3 @@ domContentLoadedTime=LESS_THAN;500;600 backEndTime=LESS_THAN;400;600 frontEndTime=LESS_THAN;300;400 firstPaintTime=LESS_THAN;500;600 -# Gzip requests -requestsWithoutGZipPerPage=LESS_THAN;1.0;1.0 \ No newline at end of file From 7a8495603be9ad009c31fe4f9dcc645ead65620b Mon Sep 17 00:00:00 2001 From: soulgalore Date: Sat, 23 Nov 2013 22:27:48 +0100 Subject: [PATCH 4/8] show number of requests missing gzip closes #315 --- .../inc/pages/column-headers/requestsWithoutGZipPerPage.vm | 2 ++ .../velocity/inc/pages/columns/requestsWithoutGZipPerPage.vm | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 report/velocity/inc/pages/column-headers/requestsWithoutGZipPerPage.vm create mode 100644 report/velocity/inc/pages/columns/requestsWithoutGZipPerPage.vm diff --git a/report/velocity/inc/pages/column-headers/requestsWithoutGZipPerPage.vm b/report/velocity/inc/pages/column-headers/requestsWithoutGZipPerPage.vm new file mode 100644 index 000000000..bede44fb5 --- /dev/null +++ b/report/velocity/inc/pages/column-headers/requestsWithoutGZipPerPage.vm @@ -0,0 +1,2 @@ +#set($tooltipMissingGZipText = "The number of text assets missing GZip") +#columnHeaderHTML("requests missing gzip","int",$tooltipMissingGZipText,"")## \ No newline at end of file diff --git a/report/velocity/inc/pages/columns/requestsWithoutGZipPerPage.vm b/report/velocity/inc/pages/columns/requestsWithoutGZipPerPage.vm new file mode 100644 index 000000000..c994e1c68 --- /dev/null +++ b/report/velocity/inc/pages/columns/requestsWithoutGZipPerPage.vm @@ -0,0 +1,5 @@ +#if($!{results.getChild("g").getChild("ycompress")})## +$results.getChild("g").getChild("ycompress").getChild("components").getChildren("item").size()## +#else## +0## +#end## \ No newline at end of file From db1fc763454e006a35ff3665cd6d4a110f76f461 Mon Sep 17 00:00:00 2001 From: soulgalore Date: Sat, 23 Nov 2013 22:28:39 +0100 Subject: [PATCH 5/8] change --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 64fc86ca0..987a04ea9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,7 +2,7 @@ CHANGELOG sitespeed.io version 2.3-wip ------------------------ -* Added the number of text assets that are missing GZIP on the summary page (xml) #310 +* Added the number of text assets that are missing GZIP on the summary page (xml) #310 and for pages #315 version 2.2.2 ------------------------ From 056fb48fdc487687883254ebd92ffc7b8c21a8ee Mon Sep 17 00:00:00 2001 From: soulgalore Date: Sun, 24 Nov 2013 12:09:02 +0100 Subject: [PATCH 6/8] added gzip files --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 492825d1a..cf6fde26e 100644 --- a/Makefile +++ b/Makefile @@ -132,6 +132,7 @@ build: @cp $(REPORT)/$(VELOCITY)/$(INC)/$(COLUMNS)/spof-html-wrapper.vm $(BUILD)/$(REPORT)/$(VELOCITY)/$(INC)/$(COLUMNS)/ @cp $(REPORT)/$(VELOCITY)/$(INC)/$(COLUMNS)/jsSyncInHead-html-wrapper.vm $(BUILD)/$(REPORT)/$(VELOCITY)/$(INC)/$(COLUMNS)/ @cp $(REPORT)/$(VELOCITY)/$(INC)/$(COLUMNS)/url-html-wrapper.vm $(BUILD)/$(REPORT)/$(VELOCITY)/$(INC)/$(COLUMNS)/ + @cp $(REPORT)/$(VELOCITY)/$(INC)/$(COLUMNS)/requestsWithoutGZipPerPage.vm $(BUILD)/$(REPORT)/$(VELOCITY)/$(INC)/$(COLUMNS)/ @cp $(REPORT)/$(VELOCITY)/$(INC)/$(COLUMN-HEADERS)/browserScaledImages.vm $(BUILD)/$(REPORT)/$(VELOCITY)/$(INC)/$(COLUMN-HEADERS)/ @cp $(REPORT)/$(VELOCITY)/$(INC)/$(COLUMN-HEADERS)/criticalPathScore.vm $(BUILD)/$(REPORT)/$(VELOCITY)/$(INC)/$(COLUMN-HEADERS)/ @cp $(REPORT)/$(VELOCITY)/$(INC)/$(COLUMN-HEADERS)/cssImagesPerPage.vm $(BUILD)/$(REPORT)/$(VELOCITY)/$(INC)/$(COLUMN-HEADERS)/ @@ -153,6 +154,7 @@ build: @cp $(REPORT)/$(VELOCITY)/$(INC)/$(COLUMN-HEADERS)/spof.vm $(BUILD)/$(REPORT)/$(VELOCITY)/$(INC)/$(COLUMN-HEADERS)/ @cp $(REPORT)/$(VELOCITY)/$(INC)/$(COLUMN-HEADERS)/genericTimeMetrics.vm $(BUILD)/$(REPORT)/$(VELOCITY)/$(INC)/$(COLUMN-HEADERS)/ @cp $(REPORT)/$(VELOCITY)/$(INC)/$(COLUMN-HEADERS)/url.vm $(BUILD)/$(REPORT)/$(VELOCITY)/$(INC)/$(COLUMN-HEADERS)/ + @cp $(REPORT)/$(VELOCITY)/$(INC)/$(COLUMN-HEADERS)/requestsWithoutGZipPerPage.vm $(BUILD)/$(REPORT)/$(VELOCITY)/$(INC)/$(COLUMN-HEADERS)/ package: @mv build sitespeed.io-$(SITESPEED_IO_VERSION) @tar -cvzf sitespeed.io-$(SITESPEED_IO_VERSION).tar.gz sitespeed.io-$(SITESPEED_IO_VERSION)/ From 9f786774532066d246bfbf6da1c6a5421dc986fe Mon Sep 17 00:00:00 2001 From: soulgalore Date: Mon, 2 Dec 2013 10:06:34 +0100 Subject: [PATCH 7/8] fix for browser parameters in Jenkins --- bin/sitespeed.io | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/sitespeed.io b/bin/sitespeed.io index 2638c27c2..e52459310 100755 --- a/bin/sitespeed.io +++ b/bin/sitespeed.io @@ -805,6 +805,9 @@ then local pagefilename=$(get_filename $url $runs) echo "Collecting Browser Time metrics: $url" + ## Fix when shuffling the parameters from Java (Jenkins), then the " will be passed and needs to be removed + BROWSER_TIME_PARAMS=${BROWSER_TIME_PARAMS//[\"]/} + $BROWSERTIME --compact --raw $BROWSER_TIME_PARAMS -o "$REPORT_DATA_METRICS_DIR/$pagefilename.xml" -ua "\"$USER_AGENT\"" -w $VIEWPORT "$url" ## If BrowserTime fails, an empty file is created, so remove it From 1f9fc8cff6d129b4aefb072cf64d034f3b4706aa Mon Sep 17 00:00:00 2001 From: soulgalore Date: Mon, 2 Dec 2013 10:10:02 +0100 Subject: [PATCH 8/8] removed requestsWithoutGZipPerPage as default for now --- CHANGELOG | 3 ++- bin/sitespeed.io | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 987a04ea9..12b25dabf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,7 +2,8 @@ CHANGELOG sitespeed.io version 2.3-wip ------------------------ -* Added the number of text assets that are missing GZIP on the summary page (xml) #310 and for pages #315 +* Added the number of text assets that are missing GZIP on the summary page (xml) #310 and for pages #315. Add it by the name requestsWithoutGZipPerPage +* Fix in how to handle browser parameters, to get it to work clean with Jenkins version 2.2.2 ------------------------ diff --git a/bin/sitespeed.io b/bin/sitespeed.io index e52459310..ffae3cf71 100755 --- a/bin/sitespeed.io +++ b/bin/sitespeed.io @@ -284,7 +284,7 @@ if [ "$SUMMARY_BOXES" != "" ] SUMMARY_BOXES="-Dcom.soulgalore.velocity.key.boxes=$SUMMARY_BOXES" else # Default columns - SUMMARY_BOXES="-Dcom.soulgalore.velocity.key.boxes=ruleScore,criticalPathScore,jsSyncInHead,jsPerPage,cssPerPage,cssImagesPerPage,imagesPerPage,requests,requestsWithoutExpires,requestsWithoutGZipPerPage,pageWeight,docWeight,imageWeightPerPage,browserScaledImages,spofPerPage,domainsPerPage,domElements,assetsCacheTime,timeSinceLastModification" + SUMMARY_BOXES="-Dcom.soulgalore.velocity.key.boxes=ruleScore,criticalPathScore,jsSyncInHead,jsPerPage,cssPerPage,cssImagesPerPage,imagesPerPage,requests,requestsWithoutExpires,pageWeight,docWeight,imageWeightPerPage,browserScaledImages,spofPerPage,domainsPerPage,domElements,assetsCacheTime,timeSinceLastModification" if $COLLECT_BROWSER_TIMINGS then SUMMARY_BOXES="$SUMMARY_BOXES",serverResponseTime,backEndTime,pageDownloadTime,frontEndTime,domContentLoadedTime,pageLoadTime