Skip to content

Instantly share code, notes, and snippets.

@tateisu tateisu/checkRetry.pl
Last active Oct 11, 2019

Embed
What would you like to do?
check sidekiq retry
#!/usr/bin/perl
use strict;
use warnings;
use JSON::XS;
use Data::Dump qw(dump);
open(my $fh,"-|","docker exec mastodon1_redis_1 redis-cli zrange retry 0 -1")
or die "can't open redis-cli. $!";
my %deliv;
my %other;
while(<$fh>){
my $data = decode_json $_;
my $class = $data->{class} // "";
if( $class eq "ActivityPub::DeliveryWorker" ){
if( ($data->{error_message} //"") =~ m|https://([^/\s]+)| ){
my $host = $1;
$deliv{ $host } ++;
next;
}
}
$other{$class}++;
# print dump($data),"\n";
}
sub dumpCount($$){
my($caption,$h)=@_;
for ( sort{ $h->{$b} <=> $h->{$a} } keys %$h ){
print "$caption $h->{$_} $_\n";
}
}
dumpCount "delivery error: ",\%deliv;
dumpCount "other error: ",\%other;
$ perl checkRetry.pl
delivary error: 271 accela.online
delivary error: 166 theboss.tech
delivary error: 162 misskey.xyz
delivary error: 161 mastadon.jp
delivary error: 101 mstdn.tw
delivary error: 98 pleroma.nakayoshi.tk
delivary error: 94 alserver.jp
delivary error: 87 mastodon.aquarla.net
delivary error: 87 mstdn.xpcoin.jp
delivary error: 87 altdn.me
delivary error: 87 cironnup.com
delivary error: 87 pleroma.ddns.net
delivary error: 86 shigadon.com
delivary error: 86 twitchain.net
delivary error: 86 mstdn-newprofession.jp
delivary error: 86 mastodon.openpsychology.net
delivary error: 86 mastodon.hakoai.com
delivary error: 27 yakiniku.cloud
delivary error: 16 pleroma.soykaf.com
delivary error: 10 mastodoll.net
delivary error: 8 dotdon.jp
delivary error: 7 roma.sftblw.moe
delivary error: 7 sumikko.club
delivary error: 7 lifeisabug.com
delivary error: 7 plero.ma
delivary error: 7 bird.waytt.cf
delivary error: 3 anime.website
delivary error: 3 misskists.gq
delivary error: 1 abyss.fun
delivary error: 1 hige.alterna-cloud.com
delivary error: 1 hashtag-relay.dtp-mstdn.jp
other error: 9 ActivityPub::ProcessingWorker
other error: 1 ResolveAccountWorker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.