added document weight from the curl to fetch it gzipped
This commit is contained in:
parent
2fcb173a2c
commit
e543f46e17
|
|
@ -69,9 +69,8 @@ error#end#end
|
|||
|
||||
## Verify the doc weight, needs to be small for mobile, should also
|
||||
## take inconcideration total weight.
|
||||
## in the future when we can check gzip, these values should be smaller
|
||||
#macro ( weightMobileType $weight )
|
||||
#if ($weight<100000)success#elseif ($weight<150000)
|
||||
#if ($weight<10000)success#elseif ($weight<15000)
|
||||
warning#else
|
||||
error#end#end
|
||||
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@
|
|||
#set($imageWeight = $math.roundTo(1,$math.div($document.getRootElement().getChild("stats").getChild("image").getChild("w").getValue(),1000)))
|
||||
#set($cssImageWeight = $math.roundTo(1,$math.div($document.getRootElement().getChild("stats").getChild("cssimage").getChild("w").getValue(),1000)))
|
||||
#set($flashWeight = $math.roundTo(1,$math.div($document.getRootElement().getChild("stats").getChild("flash").getChild("w").getValue(),1000)))
|
||||
#set($docWeight = $math.roundTo(1,$math.div($document.getRootElement().getChild("stats").getChild("doc").getChild("w").getValue(),1000)))
|
||||
#set($totalWeight = $math.roundTo(1,$math.div($totalWeight,1000)))
|
||||
#set($docWeightCurl = $math.roundTo(1,$math.div($document.getRootElement().getAttribute("size").getValue(),1000)))
|
||||
|
||||
|
||||
#if(!$cssImageWeight) #set($cssImageWeight=0) #end
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@
|
|||
<tbody>
|
||||
<tr>
|
||||
<td>doc</td>
|
||||
<td>$docWeight kb</td>
|
||||
<td>$docWeightCurl ($docWeight) kb</td>
|
||||
</tr>
|
||||
#if ($jsWeight>0)
|
||||
<tr>
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@
|
|||
|
||||
<td>
|
||||
## The size of the document
|
||||
$math.roundTo(1,$math.div($results.getChild("stats").getChild("doc").getChild("w").getValue(),1000))
|
||||
$math.roundTo(1,$math.div($results.getAttribute("size").getValue(),1000))
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@
|
|||
#end
|
||||
|
||||
#if($!{results.getChild("stats").getChild("doc").getChild("w")})
|
||||
$statsDocumentWeight.addValue($math.toInteger($results.getChild("stats").getChild("doc").getChild("w").getValue()))
|
||||
$statsDocumentWeight.addValue($math.toInteger($results.getAttribute("size").getValue()))
|
||||
#end
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@
|
|||
<div class="span4">
|
||||
<div class="alert alert-#textContentType($textContentAverage)">
|
||||
Amount of text content
|
||||
<div><a href="#" rel="popover" class="alert-#textContentType($textContentAverage) large" data-trigger="hover" title="The average amount of text content on a page" data-content="$textContentText">$textContentAverage %</a> ($textContentMedian %)</div>
|
||||
<div><a href="#" rel="popover" class="alert-#textContentType($textContentAverage) large" data-trigger="hover" title="The average amount of text content on a page" data-content="$textContentText">$textContentAverage %</a> ($textContentMedian)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
17
sitespeed.io
17
sitespeed.io
|
|
@ -70,17 +70,18 @@ analyze() {
|
|||
# And crazy enough, sometimes we get things after the end of the xml
|
||||
sed -n '1,/<\/results>/p' $REPORT_DATA_PAGES_DIR/$pagefilename-bup > $REPORT_DATA_PAGES_DIR/$pagefilename.xml || exit 1
|
||||
|
||||
# ttfb
|
||||
for i in `seq $TIMES_TTFB`; do curl $USER_AGENT_CURL --compressed -o /dev/null -w "%{time_starttransfer}\n" -s $url ; done > "$REPORT_DATA_PAGES_DIR/$pagefilename.ttfb"
|
||||
cat "$REPORT_DATA_PAGES_DIR/$pagefilename.ttfb" | head -$TIMES_TTFB | tr " " "\t" | cut -f13 |awk 'ttt += $1 {print ttt/NR}'| tail -1 > "$REPORT_DATA_PAGES_DIR/$pagefilename.ttfb-1"
|
||||
# ttfb & page size
|
||||
curl $USER_AGENT_CURL --compressed -o /dev/null -w "%{time_starttransfer};%{size_download}\n" -s $url > "$REPORT_DATA_PAGES_DIR/$pagefilename.info"
|
||||
|
||||
read -r TTFB < $REPORT_DATA_PAGES_DIR/$pagefilename.ttfb-1
|
||||
read -r TTFB_SIZE < $REPORT_DATA_PAGES_DIR/$pagefilename.info
|
||||
TTFB="$(echo $TTFB_SIZE | cut -d \; -f 1)"
|
||||
SIZE="$(echo $TTFB_SIZE | cut -d \; -f 2)"
|
||||
TTFB="$(printf "%.3f" $TTFB)"
|
||||
rm "$REPORT_DATA_PAGES_DIR/$pagefilename.ttfb"
|
||||
rm "$REPORT_DATA_PAGES_DIR/$pagefilename.ttfb-1"
|
||||
|
||||
|
||||
rm "$REPORT_DATA_PAGES_DIR/$pagefilename.info"
|
||||
|
||||
# Hack for adding link to the output file name
|
||||
sed 's/<results>/<results filename="'$pagefilename'" ttfb="'$TTFB'">/g' $REPORT_DATA_PAGES_DIR/$pagefilename.xml > $REPORT_DATA_PAGES_DIR/$pagefilename-bup || exit 1
|
||||
sed 's/<results>/<results filename="'$pagefilename'" ttfb="'$TTFB'" size="'$SIZE'">/g' $REPORT_DATA_PAGES_DIR/$pagefilename.xml > $REPORT_DATA_PAGES_DIR/$pagefilename-bup || exit 1
|
||||
mv $REPORT_DATA_PAGES_DIR/$pagefilename-bup $REPORT_DATA_PAGES_DIR/$pagefilename.xml
|
||||
|
||||
$JAVA -Xmx"$JAVA_HEAP"m -Xms"$JAVA_HEAP"m -jar $DEPENDENCIES_DIR/$VELOCITY_JAR $REPORT_DATA_PAGES_DIR/$pagefilename.xml $VELOCITY_DIR/page.vm $PROPERTIES_DIR/page.properties $REPORT_PAGES_DIR/$pagefilename.html || exit 1
|
||||
|
|
|
|||
Loading…
Reference in New Issue