tangled
alpha
login
or
join now
mackuba.eu
/
pulsar
9
fork
atom
A tool for measuring the coverage of Bluesky/ATProto relays
9
fork
atom
overview
issues
pulls
pipelines
connect to jetstream sources
mackuba.eu
2 weeks ago
a8bc2400
f3de882d
+8
-4
1 changed file
expand all
collapse all
unified
split
run_test.rb
+8
-4
run_test.rb
···
8
8
9
9
config = YAML.load(File.read(SOURCES))
10
10
11
11
-
relays = config['relays']
11
11
+
relays = config['relays'] || []
12
12
+
jetstreams = config['jetstreams'] || []
12
13
duration = config['duration']&.to_i || 60 * 15
13
13
-
maxlen = relays.map(&:length).max
14
14
+
15
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
37
-
relays.each do |host|
39
39
+
sources = relays.map { |h| [:firehose, h] } + jetstreams.map { |h| [:jetstream, h] }
40
40
+
41
41
+
sources.each do |type, host|
38
42
input, output = IO.pipe
39
43
40
44
pid = fork do
41
45
input.close
42
42
-
sky = Skyfall::Firehose.new(host)
46
46
+
sky = (type == :firehose) ? Skyfall::Firehose.new(host) : Skyfall::Jetstream.new(host)
43
47
44
48
events = 0
45
49
users = Set.new