Uptime calculation via Hudson + SiteMonitor Plugin
Hi,
The uptime is the percentage of time that one site is reachable, sometime uptime is a measure regulated by a contracts, in that case is important to track it.
We need Hudson up and running with the SiteMonitor plugin installed.
Every builds the site monitor checks if a site is up, if it is the build is succesfull otherwise it fails.
This info is tracked in the build logs, so with a script we can calculate the number of succesfull builds over the total builds.
Here is the shell script
1 2 3 4 5 6 7 8 |
cd ../builds cat `find . -name log -mtime -30` | grep Finished >m$$ mtot=$( cat m$$ | grep -c Finished ); msuc=$( cat m$$ | grep -c SUCCESS ); mper=$(echo "scale = 3; $msuc/$mtot" | bc) echo UPTIME echo Last 30 days = $mper |