Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit eae0b7d

Browse files
fix: process flakes summary usage (#1218)
1 parent 7a25b06 commit eae0b7d

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

services/processing/flake_processing.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,12 @@
1010
TestInstance,
1111
)
1212

13-
from services.test_analytics.ta_metrics import process_flakes_summary
14-
1513
log = logging.getLogger(__name__)
1614

1715

1816
FLAKE_EXPIRY_COUNT = 30
1917

2018

21-
@process_flakes_summary.labels("old").time()
2219
def process_flake_for_repo_commit(
2320
repo_id: int,
2421
commit_id: str,

services/test_analytics/ta_process_flakes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ def handle_failure(
7777
curr_flakes[test_id] = new_flake
7878

7979

80-
@process_flakes_summary.labels("new").time()
8180
def process_flakes_for_commit(repo_id: int, commit_id: str):
8281
uploads = get_relevant_uploads(repo_id, commit_id)
8382

@@ -116,7 +115,8 @@ def process_flakes_for_repo(repo_id: int):
116115
with redis_client.lock(lock_name, timeout=300, blocking_timeout=3):
117116
while commit_ids := redis_client.lpop(key_name, 10):
118117
for commit_id in commit_ids:
119-
process_flakes_for_commit(repo_id, commit_id.decode())
118+
with process_flakes_summary.labels("new").time():
119+
process_flakes_for_commit(repo_id, commit_id.decode())
120120
return True
121121
except LockError:
122122
log.warning("Failed to acquire lock for repo %s", repo_id)

tasks/process_flakes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
from app import celery_app
1111
from services.processing.flake_processing import process_flake_for_repo_commit
12+
from services.test_analytics.ta_metrics import process_flakes_summary
1213
from services.test_analytics.ta_process_flakes import process_flakes_for_repo
1314
from tasks.base import BaseCodecovTask
1415

@@ -89,7 +90,8 @@ def run_impl(
8990
break
9091

9192
for commit_sha in commit_shas:
92-
process_func(repo_id, commit_sha.decode())
93+
with process_flakes_summary.labels("old").time():
94+
process_func(repo_id, commit_sha.decode())
9395

9496
except LockError:
9597
log.warning("Unable to acquire process flakeslock for key %s.", lock_name)

0 commit comments

Comments
 (0)