A tool for measuring the coverage of Bluesky/ATProto relays
9
fork

Configure Feed

Select the types of activity you want to include in your feed.

save host type in the report

+22 -4
+9
db/migrate/20260303020428_add_type_to_reports.rb
··· 1 + class AddTypeToReports < ActiveRecord::Migration[7.0] 2 + def up 3 + add_column :reports, :source_type, :string, null: false 4 + end 5 + 6 + def down 7 + remove_column :reports, :source_type 8 + end 9 + end
+2 -1
db/schema.rb
··· 10 10 # 11 11 # It's strongly recommended that you check this file into your version control system. 12 12 13 - ActiveRecord::Schema[7.2].define(version: 2026_03_02_043512) do 13 + ActiveRecord::Schema[7.2].define(version: 2026_03_03_020428) do 14 14 create_table "reports", force: :cascade do |t| 15 15 t.datetime "start_time", precision: 0, null: false 16 16 t.string "host", null: false 17 17 t.integer "duration", null: false 18 18 t.integer "users", null: false 19 19 t.integer "events", null: false 20 + t.string "source_type", null: false 20 21 t.index ["start_time"], name: "index_reports_on_start_time" 21 22 end 22 23 end
+6 -1
report.rb
··· 1 1 class Report < ActiveRecord::Base 2 - validates_presence_of :start_time, :host, :duration, :users, :events 2 + enum :source_type, { 3 + jetstream: 'jetstream', 4 + firehose: 'firehose' 5 + } 6 + 7 + validates_presence_of :start_time, :host, :duration, :users, :events, :source_type 3 8 end
+3 -2
run_test.rb
··· 31 31 duration = options[:duration] || config['duration']&.to_i || 60 * 15 32 32 test_start_time = Time.now 33 33 34 - Worker = Struct.new(:host, :pid, :pipe) 34 + Worker = Struct.new(:host, :type, :pid, :pipe) 35 35 workers = [] 36 36 37 37 sources = relays.map { |h| [:firehose, h] } + jetstreams.map { |h| [:jetstream, h] } ··· 74 74 75 75 output.close 76 76 77 - workers << Worker.new(host, pid, input) 77 + workers << Worker.new(host, type, pid, input) 78 78 end 79 79 80 80 begin ··· 97 97 start_time: test_start_time, 98 98 duration: duration, 99 99 host: worker.host, 100 + source_type: worker.type, 100 101 users: users, 101 102 events: events 102 103 )
+2
views/index.erb
··· 6 6 <table border> 7 7 <tr> 8 8 <th>Host</th> 9 + <th>Type</th> 9 10 <th>Users</th> 10 11 <th>Events</th> 11 12 <th>% of max</th> ··· 16 17 17 18 <tr> 18 19 <td><%= report.host %></td> 20 + <td><%= report.source_type %></td> 19 21 <td><%= report.users %></td> 20 22 <td><%= report.events %></td> 21 23 <td><%= format('%.1f%%', percent) %></td>