def calculate(self):
best, worst, fastest, slowest = (), (), (), ()<EOL>found = notfound = total_time = <NUM_LIT:0><EOL>for source, rec in self.source_stats.items():<EOL><INDENT>if not best or rec.successes > best[<NUM_LIT:1>]:<EOL><INDENT>best = (source, rec.successes, rec.success_rate())<EOL><DEDENT>if not worst or rec.successes < worst[<NUM_LIT:1>]:<EOL><INDENT>worst = (source, rec.successes, rec.success_rate())<EOL><DEDENT>avg_time = self.avg_time(source)<EOL>if not fastest or (avg_time != <NUM_LIT:0> and avg_time < fastest[<NUM_LIT:1>]):<EOL><INDENT>fastest = (source, avg_time)<EOL><DEDENT>if not slowest or (avg_time != <NUM_LIT:0> and avg_time > slowest[<NUM_LIT:1>]):<EOL><INDENT>slowest = (source, avg_time)<EOL><DEDENT>found += rec.successes<EOL>notfound += rec.fails<EOL>total_time += sum(rec.runtimes)<EOL><DEDENT>return {<EOL>'<STR_LIT>': best,<EOL>'<STR_LIT>': worst,<EOL>'<STR_LIT>': fastest,<EOL>'<STR_LIT>': slowest,<EOL>'<STR_LIT>': found,<EOL>'<STR_LIT>': notfound,<EOL>'<STR_LIT>': total_time<EOL>}<EOL>
Calculate the overall counts of best, worst, fastest, slowest, total
found, total not found and total runtime

Results are returned in a dictionary with the above parameters as keys.