From 7174266379763883cde9fc978fe2fbecabca1474 Mon Sep 17 00:00:00 2001 From: nobe4 Date: Tue, 22 Sep 2026 19:48:35 +0200 Subject: [PATCH] feat(logs): add logs for timing information This will hopefully help debug the current hangs we're facing. --- Gemfile.lock | 2 +- lib/entitlements.rb | 3 +++ lib/version.rb | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9b53a40..c62559c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - entitlements-app (1.2.5) + entitlements-app (1.2.6) concurrent-ruby (~> 1.3, >= 1.3.1) dogstatsd-ruby (~> 5.7) faraday (~> 2.0) diff --git a/lib/entitlements.rb b/lib/entitlements.rb index 2be391f..e083389 100644 --- a/lib/entitlements.rb +++ b/lib/entitlements.rb @@ -491,6 +491,8 @@ def self.calculate_actions calc_start = Time.now actions = [] Entitlements.child_classes.map do |group_name, obj| + group_start = Time.now + logger.debug("Begin calculation for #{group_name}") provider = Entitlements.config["groups"].fetch(group_name).fetch("type") timed_operation(phase: "calculate", provider: provider, target: group_name) { obj.calculate } if obj.change_count > 0 @@ -498,6 +500,7 @@ def self.calculate_actions cache[:change_count] += obj.change_count end actions.concat(obj.actions) + logger.debug("Finished calculation for #{group_name} in #{Time.now - group_start}") end logger.debug("Finished all calculations in #{Time.now - calc_start}") logger.debug("Finished all prefetch, validate, and calculation in #{Time.now - prep_start}") diff --git a/lib/version.rb b/lib/version.rb index 0dd6539..7f933cc 100644 --- a/lib/version.rb +++ b/lib/version.rb @@ -2,6 +2,6 @@ module Entitlements module Version - VERSION = "1.2.5" + VERSION = "1.2.6" end end