Skip to content
This repository has been archived by the owner on Mar 29, 2021. It is now read-only.

Commit

Permalink
Fix total size report for inner links (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
toubib committed Jan 28, 2016
1 parent 125ba0e commit 4026f60
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions check_webpage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,12 @@ def getInnerLinks (mainUrl, data, httpHeaders, reports, proxy)
end
end

if DEBUG >= 1 then puts "[#{res.code}] #{res.message} s(#{reports['totalSize']}) t(#{Time.now-startedTime})" end

## inner links part
###############################################################
getInnerLinks(mainUrl, res_body, httpHeaders, reports, proxy) unless GET_INNER_LINKS == 0

## set total size report
###############################################################
if reports['totalSize'] < 1000
Expand All @@ -599,19 +605,13 @@ def getInnerLinks (mainUrl, data, httpHeaders, reports, proxy)
totalSizeReport = (reports['totalSize']/1000).to_s + "KB"
end

if DEBUG >= 1 then puts "[#{res.code}] #{res.message} s(#{totalSizeReport}) t(#{Time.now-startedTime})" end

#send data to graphite
if !GRAPHITE_HOST.nil?
graphite = Graphite.new(GRAPHITE_HOST)
graphite.push GRAPHITE_BUCKET+'.'+'mainpage_time', (Time.now-startedTime)*1000
graphite.push GRAPHITE_BUCKET+'.'+'mainpage_size', reports['totalSize']
end

## inner links part
###############################################################
getInnerLinks(mainUrl, res_body, httpHeaders, reports, proxy) unless GET_INNER_LINKS == 0

## Get Statistics
###############################################################
finishedTime = Time.now
Expand Down

0 comments on commit 4026f60

Please sign in to comment.