summaryrefslogtreecommitdiff
path: root/db-pick-mirror
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-04-17 10:58:22 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-04-17 11:10:57 -0400
commitbf2cb9784fe726b163667aaeab541cf7ae7f21a9 (patch)
treedb3706dad0ccfc5ac4fbd43aa6241a689e8e3e96 /db-pick-mirror
parent03c3068761682bb1af9c615c91bc30da67fddf06 (diff)
Give things more consistent names.
Diffstat (limited to 'db-pick-mirror')
-rwxr-xr-xdb-pick-mirror25
1 files changed, 0 insertions, 25 deletions
diff --git a/db-pick-mirror b/db-pick-mirror
deleted file mode 100755
index 4d01b95..0000000
--- a/db-pick-mirror
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'json'
-require 'net/http'
-
-protocol = ARGV[0]
-jsonurl = ARGV[1]
-
-data = JSON::parse(Net::HTTP.get(URI(jsonurl)))
-
-if data["version"] != 3
- print "Data format version != 3"
- exit 1
-end
-
-# Filter out URLs with incomplete information
-urls = data["urls"].select{|a| a.none?{|k,v|v.nil?}}
-rsync_urls = urls.select{|a| a["protocol"]==protocol}
-
-# By score ( (delay+speed)/completion )
-#best = rsync_urls.sort{|a,b| (a["score"] || Float::INFINITY) <=> (b["score"] || Float::INFINITY) }.first
-# By delay/completion
-best = rsync_urls.sort{|a,b| a["delay"]/a["completion_pct"] <=> b["delay"]/b["completion_pct"] }.first
-
-puts best["url"]