I'm planning to develop a script to check the uptime percentage of my server. By uptime percentage I mean something like 99.7% or something like that. As every webhost says they provide 99.9% uptime, I want to write a script which will actually check that what is the uptime percentage actually.
I do know how to get the uptime in terms of seconds or hr-min-sec. I use this below script for that purpose.
$uptime = shell_exec("cut -d. -f1 /proc/uptime");
But, what I'm not getting is how can I calculate the uptime percentage like 99% uptime or something like that. I'm looking for some ideas and help on this.
I will be really happy if you guys share some opinion and help about thing instead giving negative vote to this question.
P.S.: I've already checked this question: Measuring server uptime but this does not answer my problem.