Skip to content

Commit

Permalink
logging: output processing time for extract and load
Browse files Browse the repository at this point in the history
  • Loading branch information
cgsheeh committed Oct 31, 2024
1 parent 3e14b66 commit 7f0ae16
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import os
import pprint
import sys
import time
from dataclasses import dataclass
from datetime import datetime
from enum import IntEnum
Expand Down Expand Up @@ -580,6 +581,8 @@ def process():
for revision in updated_revisions:
logging.info(f"Processing revision D{revision.id}.")

phab_querying_start = time.perf_counter()

bug_id = get_bug_id(revision, bug_id_query)

diffs, changesets, date_landed = get_diffs_changesets(
Expand Down Expand Up @@ -615,10 +618,19 @@ def process():

comments = get_comments(revision, session_diff, session_users)

phab_gathering_time = round(
time.perf_counter() - phab_querying_start, ndigits=2
)
logging.info(
f"Gathered relevant info for D{revision.id} in {phab_gathering_time}s."
)

if DEBUG:
pprint.pprint(revision_json)
continue

bigquery_insert_start = time.perf_counter()

# Send data to BigQuery.
submit_to_bigquery(
bq_client,
Expand Down Expand Up @@ -652,7 +664,12 @@ def process():
comments,
)

logging.info(f"Submitted revision D{revision.id} in BigQuery.")
bigquery_insert_time = round(
time.perf_counter() - bigquery_insert_start, ndigits=2
)
logging.info(
f"Submitted revision D{revision.id} in BigQuery in {bigquery_insert_time}s."
)


if __name__ == "__main__":
Expand Down

0 comments on commit 7f0ae16

Please sign in to comment.