Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define the connection health #3

Open
MrSunshyne opened this issue Feb 1, 2020 · 0 comments
Open

Define the connection health #3

MrSunshyne opened this issue Feb 1, 2020 · 0 comments

Comments

@MrSunshyne
Copy link
Owner

At the start of the project, the connection health is defined as follows :

Anything above 20MBps is considered 'healthy'. Obviously there can be other parameters to determine what a healthy connection is.

This is a temporary solution just to get the project going. It is reasonable for now since most households in Mauritius have the 20M package.

If you believe there are better ways to determine the health of a connection, please hop into the conversation!

Initial implementation:

	function calculateHealth(value) {
		const lowerLimit = 0;
		const upperLimit = 20;

		let valuePercentage = ((value - lowerLimit) / upperLimit) * 100

		if (valuePercentage > 80) {
			health = "healthy";
		} else if (valuePercentage > 30) {
			health = "degraded";
		} else if (valuePercentage > 10) {
			health = "offline";
		} else {
			health = "outage";
		}

		return health;
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant