Skip to content

Commit

Permalink
threshold warning logic
Browse files Browse the repository at this point in the history
  • Loading branch information
timcowlishaw committed Oct 22, 2024
1 parent 2adfd21 commit a728506
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/tasks/mqtt_subscriber.rake
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ namespace :mqtt do
end
mqtt_log.info "Processed MQTT message in #{time}"
mqtt_log.info "MQTT queue length: #{client.queue_length}"
if !threshold_passed && client.queue_length >= mqtt_queue_length_warning_threshold
threshold_passed = true
Sentry.capture_message("Warning: Internal MQTT queue length is #{client.queue_length} (>= #{mqtt_queue_length_warning_threshold} on client #{mqtt_client_id}).")
if client.queue_length >= mqtt_queue_length_warning_threshold
if !threshold_passed
Sentry.capture_message("Warning: Internal MQTT queue length is #{client.queue_length} (>= #{mqtt_queue_length_warning_threshold} on client #{mqtt_client_id}).")
threshold_passed = true
end
else
threshold_passed = false
end
Expand Down

0 comments on commit a728506

Please sign in to comment.