Skip to content

Negative percentage are getting calculated #4

Description

@intesar

Bug in the below code

Calculates percentage downtime for a week in minutes.

/**
* calculates percentage down time
* @PARAM downMins
* @return
*/
private double getUpPercentage(long downMins) {
double upPercentage = HUNDERED;
if (downMins > ZERO) {
upPercentage = (HUNDERED - ((downMins * HUNDERED) / TOTAL_WEEK_MINS));
}
return upPercentage;
}


Sample emails showing uptime as negative....

Site : http://hiox.org/33178-new-google.php
Uptime : -82.0%
Total Mins down : 18392

Site : http://www.zytoon.me/monitor/
Uptime : -173.0%
Total Mins down : 27525

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions