A tool for measuring the coverage of Bluesky/ATProto relays

connect to jetstream sources

+8 -4
+8 -4
run_test.rb
··· 8 8 9 9 config = YAML.load(File.read(SOURCES)) 10 10 11 - relays = config['relays'] 11 + relays = config['relays'] || [] 12 + jetstreams = config['jetstreams'] || [] 12 13 duration = config['duration']&.to_i || 60 * 15 13 - maxlen = relays.map(&:length).max 14 + 15 + maxlen = (relays + jetstreams).map(&:length).max 14 16 verbose = false 15 17 16 18 def print_help ··· 34 36 Worker = Struct.new(:host, :pid, :pipe) 35 37 workers = [] 36 38 37 - relays.each do |host| 39 + sources = relays.map { |h| [:firehose, h] } + jetstreams.map { |h| [:jetstream, h] } 40 + 41 + sources.each do |type, host| 38 42 input, output = IO.pipe 39 43 40 44 pid = fork do 41 45 input.close 42 - sky = Skyfall::Firehose.new(host) 46 + sky = (type == :firehose) ? Skyfall::Firehose.new(host) : Skyfall::Jetstream.new(host) 43 47 44 48 events = 0 45 49 users = Set.new