Skip to content

Commit

Permalink
(reco) add log_duration to monitor get_nearest_offer
Browse files Browse the repository at this point in the history
  • Loading branch information
LucileRainteau committed Sep 20, 2023
1 parent 0e8533b commit 1807401
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/recommendation/api/src/huggy/core/scorer/offer.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,12 @@ def get_recommendable_offers(
recommendable_items: List[RecommendableItem],
) -> List[RecommendableOffer]:

start = time.time()
recommendable_offers = get_nearest_offers(db, self.user, recommendable_items)

log_duration(
f"get_nearest_offers {str(self.user.user_id)} offers : {len(recommendable_offers)}",
start,
)
size = len(recommendable_offers)

for i, recommendable_offer in enumerate(recommendable_offers):
Expand Down

0 comments on commit 1807401

Please sign in to comment.