Skip to content

Commit

Permalink
[#2536] Log after_empty_receive
Browse files Browse the repository at this point in the history
Co-authored-by: Jane Sandberg <[email protected]>
Co-authored-by: Kevin Reiss <[email protected]>
Co-authored-by: regineheberlein <[email protected]>
Co-authored-by: Ryan Laddusaw <[email protected]>
  • Loading branch information
5 people committed Oct 22, 2024
1 parent 70be295 commit 2d5047c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions app/services/aws_sqs_poller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ def self.poll
end_polling = true
end

poller.after_empty_receive do |stats|
Rails.logger.info("AWS SQS Poller after_empty_receive request_count: #{stats.request_count}")
Rails.logger.info("AWS SQS Poller after_empty_receive received_message_count: #{stats.received_message_count}")
Rails.logger.info("AWS SQS Poller after_empty_receive last_message_received_at: #{stats.last_message_received_at}")
end

poller.before_request do |stats|
Rails.logger.info("AWS SQS Poller request_count: #{stats.request_count}")
Rails.logger.info("AWS SQS Poller message_count: #{stats.received_message_count}")
Rails.logger.info("AWS SQS Poller last_message_received_at: #{stats.last_message_received_at}")
Rails.logger.info("AWS SQS Poller before_request request_count: #{stats.request_count}")
Rails.logger.info("AWS SQS Poller before_request message_count: #{stats.received_message_count}")
Rails.logger.info("AWS SQS Poller before_request last_message_received_at: #{stats.last_message_received_at}")
throw :stop_polling if end_polling
end

Expand Down

0 comments on commit 2d5047c

Please sign in to comment.