def crawler(name): crawler = get_crawler(name) stages = [] for stage in crawler: data = Event.get_stage_counts(crawler, stage) data["total_ops"] = stage.op_count data["stage"] = stage stages.append(data) runs = list(crawler.runs) for run in runs: run.update(Event.get_run_counts(crawler, run["run_id"])) runs = sorted(runs, key=lambda r: r.get("start"), reverse=True) return render_template("crawler.html", crawler=crawler, stages=stages, runs=runs)
def crawler_runs(crawler): runs = list(crawler.runs) for run in runs: run.update(Event.get_run_counts(crawler, run['run_id'])) return runs