Skip to content

Negative percentage are getting calculated #4

@intesar

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

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