Skip to content

Commit

Permalink
Add a simple bot for monitoring the BackgrounDRb tasks. Needs more wo…
Browse files Browse the repository at this point in the history
…rk though.
  • Loading branch information
leenookx committed Aug 24, 2009
1 parent e255221 commit c2133d3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions bots/background_monitor.rb
@@ -0,0 +1,34 @@
#!/usr/bin/env ruby

RAILS_ROOT = '.'

#load required rails and backgroundrb files
require File.dirname(__FILE__) + '/../config/boot'
require File.dirname(__FILE__) + '/../config/environment'
require 'erb'
$LOAD_PATH << "#{RAILS_ROOT}/vendor/plugins/backgroundrb/lib"
require "#{RAILS_ROOT}/vendor/plugins/backgroundrb/lib/backgroundrb.rb"


class BackgroundMonitor

def test
begin
puts "Raw data:"
puts MiddleMan.all_worker_info

puts
puts "Individual:"
puts MiddleMan.all_worker_info.values.flatten.select { |w|
puts w[:worker]
puts " key = #{w[:worker_key]}"
puts " status = #{w[:status]}"
}
rescue
puts "Some kind of problem occurred..."
end
end
end

monitor = BackgroundMonitor.new
monitor.test
Binary file modified db/development.sqlite3
Binary file not shown.

0 comments on commit c2133d3

Please sign in to comment.