Skip to content

Commit

Permalink
pass a writer to process_prs when backfilling
Browse files Browse the repository at this point in the history
  • Loading branch information
ghickman committed Nov 1, 2023
1 parent 62a82ca commit c396bda
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions backfill.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import structlog

from metrics import influxdb
from metrics.github.prs import process_prs
from metrics.logs import setup_logging
from metrics.tools.dates import date_from_iso, datetime_from_iso, iter_days
Expand All @@ -16,6 +17,9 @@
log = structlog.get_logger()


writer = influxdb.write


def get_data(db, orgs):
subprocess.check_call(["github-to-sqlite", "repos", db, *orgs])

Expand Down Expand Up @@ -79,7 +83,7 @@ def pr_queue(prs, org, start, days_threshold=None):
key = f"queue{suffix}"

log.info("%s | %s | %s | Processing %s PRs", key, day, org, len(prs_on_day))
process_prs(key, prs_on_day, day)
process_prs(writer, key, prs_on_day, day)


def pr_throughput(prs, org, start):
Expand Down Expand Up @@ -115,7 +119,7 @@ def next_weekday(d, weekday):

key = "throughput"
log.info("%s | %s | %s | Processing %s PRs", key, day, org, len(prs_in_range))
process_prs(key, prs_in_range, day)
process_prs(writer, key, prs_in_range, day)


if __name__ == "__main__":
Expand Down

0 comments on commit c396bda

Please sign in to comment.