def stats(self):
    rules = Counter()
    rules.update((job.rule for job in self.needrun_jobs))
    rules.update((job.rule for job in self.finished_jobs))
    (yield 'Job counts:')
    (yield '\tcount\tjobs')
    for (rule, count) in sorted(rules.most_common(), key=(lambda item: item[0].name)):
        (yield '\t{}\t{}'.format(count, rule))
    (yield '\t{}'.format(len(self)))
def stats(self):
    rules = Counter()
    rules.update((job.rule for job in self.needrun_jobs))
    rules.update((job.rule for job in self.finished_jobs))
    (yield 'Job counts:')
    (yield '\tcount\tjobs')
    for (rule, count) in sorted(rules.most_common(), key=(lambda item: item[0].name)):
        (yield '\t{}\t{}'.format(count, rule))
    (yield '\t{}'.format(len(self)))