Skip to content

Commit

Permalink
removed sitespeedio#78, the way to do it is to actually measure analy…
Browse files Browse the repository at this point in the history
…ze of one page and then estimate on that, but I can only find 1 second as the smallest time value in bash for mac os x
  • Loading branch information
soulgalore committed Nov 21, 2012
1 parent f8bc0bb commit 6bee6b6
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions sitespeed.io
Original file line number Diff line number Diff line change
Expand Up @@ -77,31 +77,6 @@ analyze() {
java -jar dependencies/htmlcompressor-1.5.3.jar --type html --compress-css --compress-js -o $REPORT_PAGES_DIR/$pagefilename.html $REPORT_PAGES_DIR/$pagefilename.html
}

#*******************************************************
# Estimate the time to analyze
# $1 the number of pages to analyze
# $2 the number of processes that will analyze
# $3 create images or not [true|false]
#*******************************************************
estimateAnalyzeTime() {

analyzeTimePerPageInSeconds=22
imageTimePerPageInSeconds=2

analyzeTime=$(( $1 / $2 * analyzeTimePerPageInSeconds ))
imageTime=0
extraTime=$(( $1 * 0,5))

if $3
then
imageTime=$(($1*imageTimePerPageInSeconds))
fi

echo "Estimated time for analyze: $((analyzeTime + imageTime + extraTime)) seconds"
}

START_TIME="$(date +%s)"

# All the options
URL=
DEPTH=
Expand Down Expand Up @@ -227,8 +202,6 @@ done < $REPORT_DATA_DIR/urls.txt

echo "Fetched ${#result[@]} pages"

estimateAnalyzeTime ${#result[@]} $MAX_PROCESSES $OUTPUT_IMAGES

# Setup start parameters, 0 jobs are running and the first file name
JOBS=0
PAGEFILENAME=1
Expand Down Expand Up @@ -303,5 +276,4 @@ if $OUTPUT_IMAGES
fi

echo "Finished, see the report $REPORT_DIR/index.html"
echo "Time for the analyze in seconds: $(($(date +%s)-START_TIME))"
exit 0

0 comments on commit 6bee6b6

Please sign in to comment.