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.

calculate max_users ignoring entries with >110% of median

+14 -2
+5
public/style.css
··· 87 87 text-align: right; 88 88 } 89 89 90 + td.number.sus { 91 + color: light-dark(#c00000, #d82020); 92 + font-weight: 600; 93 + } 94 + 90 95 td.error { 91 96 text-align: center; 92 97 }
+8 -1
server.rb
··· 37 37 38 38 if @last_test 39 39 @reports = Report.where(start_time: @last_test).order('users DESC, connected DESC').to_a 40 - @max_users = @reports.first.users 40 + 41 + if @reports.length >= 3 42 + middle = @reports.length / 2 43 + median = @reports.reverse.map(&:users)[middle] 44 + @max_users = @reports.select { |x| x.users <= median * 1.1 }.first.users 45 + else 46 + @max_users = @reports.first.users 47 + end 41 48 end 42 49 43 50 erb :index
+1 -1
views/index.erb
··· 33 33 <% if report.connected? %> 34 34 <td class="number"><%= format_num(report.users) %></td> 35 35 <td class="number"><%= format_num(report.events) %></td> 36 - <td class="number"> 36 + <td class="number <%= 'sus' if percent > 100.0 %>"> 37 37 <% if report.error_count > 0 %> 38 38 <span class="has-errors" title="Source has returned some error code responses">⚠️</span> 39 39 <% end %>