Created
June 22, 2018 06:36
-
-
Save anvinjain/3010da04a779cffe0affe1f438fa5597 to your computer and use it in GitHub Desktop.
torrent unhealthy detection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int dls_mark = x kbps; //download speed threshold | |
int dlt_mark = x secs; //download speed observation window | |
int dpt_mark = x secs; //connected peers observation window | |
int cpt_mark = x secs; //discovered peers observation window | |
if dl_speed > dls_mark { dl_ts = now(); return true; } | |
if now() - dl_ts > dlt_mark { return false; } | |
if connected_peers > 1 { cpt_ts = now(); return true; } | |
if now() - cpt_ts > cpt_mark { return false; } | |
if discovered_peers > 1 { dpt_ts = now(); return true; } | |
if now() - dpt_ts > dpt_mark { return false; } | |
return true; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment