@@ -0,0 +1,1313 @@
+from django.core.management.base import BaseCommand%0Afrom corehq.motech.repeaters.models import RepeatRecord, Repeater%0A%0A%0Aclass Command(BaseCommand):%0A    help = %22%22%22%0A    Shows the number of Repeaters and RepeatRecords per domain.%0A    %22%22%22%0A%0A    def handle(self, *args, **options):%0A        self.stdout.write(%22%5Cn%22)%0A        self.stdout.write('fetching repeater data...')%0A        repeater_summary = Repeater.get_db().view(%0A            'repeaters/repeaters',%0A            group_level=1,%0A            reduce=True%0A        ).all()%0A        repeaters_by_domain = %7Binfo%5B'key'%5D%5B0%5D: info%5B'value'%5D for info in repeater_summary%7D%0A%0A        self.stdout.write(%22%5Cn%22)%0A        self.stdout.write('fetching repeat record data...')%0A        repeat_records_summary = RepeatRecord.get_db().view(%0A            'repeaters/repeat_records',%0A            group_level=1,%0A            reduce=True%0A        ).all()%0A%0A        self.stdout.write(%22%5Cn%5Cn%5Cn%22)%0A        self.stdout.write(%22Domain%5CtRepeaters%5CtRepeatRecords%22)%0A        for info in repeat_records_summary:%0A            domain = info%5B'key'%5D%5B0%5D%0A            num_repeaters = repeaters_by_domain.get(domain, 0)%0A            num_repeat_records = info%5B'value'%5D%0A            self.stdout.write(f'%7Bdomain%7D%5Ct%7Bnum_repeaters%7D%5Ct%7Bnum_repeat_records%7D')%0A        self.stdout.write('*' * 230)%0A        self.stdout.write('done...')%0A

add management command for getting repeaters stats