Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a simple bot for monitoring the BackgrounDRb tasks. Needs more wo…
…rk though.
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 not shown.