Permalink
Browse files

Removed error rescue so full backtrace comes thru, remove alert logic…

… as a peak trigger will work
  • Loading branch information...
1 parent 01abf40 commit c46dd2c7e1a96aded220df946f714ee989deb0af @itsderek23 itsderek23 committed Oct 10, 2012
Showing with 3 additions and 15 deletions.
  1. +3 −15 starling_monitor/starling_monitor.rb
@@ -13,10 +13,6 @@ class StarlingMonitor < Scout::Plugin
name: Name Reqular Expresssion
notes: Pattern to test against queue names to select queues to monitor
default:
- max_depth:
- name: Maximum Items
- notes: Alert if the queue contains more items than this
- default: 4000
EOS
attr_accessor :connection
@@ -26,15 +22,10 @@ class StarlingMonitor < Scout::Plugin
def build_report
self.connection=Starling.new("#{option(:host)}:#{option(:port)}")
@report = {}
-
- begin
- connection.sizeof(:all).each do |queue_name,item_count|
- check_queue(queue_name,item_count) if should_check_queue?(queue_name)
- end
- report(@report)
- rescue Exception=>e
- error("Got unexpected error: #{e} #{e.class}")
+ connection.sizeof(:all).each do |queue_name,item_count|
+ check_queue(queue_name,item_count) if should_check_queue?(queue_name)
end
+ report(@report)
end
def should_check_queue?(name)
@@ -45,9 +36,6 @@ def check_queue(name,depth)
q_depth = (depth||0).to_i
@report ||= {}
@report[name] = q_depth
- if q_depth > option(:max_depth).to_i
- alert("Max Queue Depth for #{name} exceeded","#{q_depth} items is more than the max allowed #{option(:max_depth)}")
- end
end
end

0 comments on commit c46dd2c

Please sign in to comment.