Created
May 16, 2010 03:10
-
-
Save bradgessler/402612 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'beanstalk-client' | |
host = ENV['host'] || 'localhost:11300' | |
stat = File.basename(__FILE__).split('_').last | |
# stat = 'watching' # watching jobs-reserve jobs-ready using jobs-buried waiting jobs-delayed jobs-urgen | |
B = Beanstalk::Connection.new(host) | |
tubes = B.list_tubes | |
if ARGV.length > 0 && ARGV[0] == 'config' | |
puts %(graph_category Beanstalk | |
graph_title Beanstalk Tubes #{stat.split('_').map{|w| w.capitalize}.join(' ') } | |
#{tubes.map {|tube| "graph_vlabel #{tube}\n#{tube}.label #{tube}" }.join("\n")}) | |
exit(0) | |
end | |
puts tubes.collect {|tube| "#{tube}.value #{B.stats_tube(tube)["current-#{stat.gsub('_', '-')}"]}" }.join("\n") |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'beanstalk-client' | |
host = ENV['host'] || 'localhost:11300' | |
stat = File.basename(__FILE__).split('_').last | |
# stat = 'watching' # watching jobs-reserve jobs-ready using jobs-buried waiting jobs-delayed jobs-urgen | |
B = Beanstalk::Connection.new(host) | |
tubes = B.list_tubes | |
if ARGV.length > 0 && ARGV[0] == 'config' | |
puts %(graph_category Beanstalk | |
graph_title Beanstalk Tubes #{stat.split('_').map{|w| w.capitalize}.join(' ') } | |
#{tubes.map {|tube| "graph_vlabel #{tube}\n#{tube}.label #{tube}" }.join("\n")}) | |
exit(0) | |
end | |
puts tubes.collect {|tube| "#{tube}.value #{B.stats_tube(tube)["current-#{stat.gsub('_', '-')}"]}" }.join("\n") |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'beanstalk-client' | |
host = ENV['host'] || 'localhost:11300' | |
stat = File.basename(__FILE__).split('_').last | |
# stat = 'watching' # watching jobs-reserve jobs-ready using jobs-buried waiting jobs-delayed jobs-urgen | |
B = Beanstalk::Connection.new(host) | |
tubes = B.list_tubes | |
if ARGV.length > 0 && ARGV[0] == 'config' | |
puts %(graph_category Beanstalk | |
graph_title Beanstalk Tubes #{stat.split('_').map{|w| w.capitalize}.join(' ') } | |
#{tubes.map {|tube| "graph_vlabel #{tube}\n#{tube}.label #{tube}" }.join("\n")}) | |
exit(0) | |
end | |
puts tubes.collect {|tube| "#{tube}.value #{B.stats_tube(tube)["current-#{stat.gsub('_', '-')}"]}" }.join("\n") |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'beanstalk-client' | |
host = ENV['host'] || 'localhost:11300' | |
stat = File.basename(__FILE__).split('_').last | |
# stat = 'watching' # watching jobs-reserve jobs-ready using jobs-buried waiting jobs-delayed jobs-urgen | |
B = Beanstalk::Connection.new(host) | |
tubes = B.list_tubes | |
if ARGV.length > 0 && ARGV[0] == 'config' | |
puts %(graph_category Beanstalk | |
graph_title Beanstalk Tubes #{stat.split('_').map{|w| w.capitalize}.join(' ') } | |
#{tubes.map {|tube| "graph_vlabel #{tube}\n#{tube}.label #{tube}" }.join("\n")}) | |
exit(0) | |
end | |
puts tubes.collect {|tube| "#{tube}.value #{B.stats_tube(tube)["current-#{stat.gsub('_', '-')}"]}" }.join("\n") |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'beanstalk-client' | |
host = ENV['host'] || 'localhost:11300' | |
stat = File.basename(__FILE__).split('_').last | |
# stat = 'watching' # watching jobs-reserve jobs-ready using jobs-buried waiting jobs-delayed jobs-urgen | |
B = Beanstalk::Connection.new(host) | |
tubes = B.list_tubes | |
if ARGV.length > 0 && ARGV[0] == 'config' | |
puts %(graph_category Beanstalk | |
graph_title Beanstalk Tubes #{stat.split('_').map{|w| w.capitalize}.join(' ') } | |
#{tubes.map {|tube| "graph_vlabel #{tube}\n#{tube}.label #{tube}" }.join("\n")}) | |
exit(0) | |
end | |
puts tubes.collect {|tube| "#{tube}.value #{B.stats_tube(tube)["current-#{stat.gsub('_', '-')}"]}" }.join("\n") |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'beanstalk-client' | |
host = ENV['host'] || 'localhost:11300' | |
stat = File.basename(__FILE__).split('_').last | |
# stat = 'watching' # watching jobs-reserve jobs-ready using jobs-buried waiting jobs-delayed jobs-urgen | |
B = Beanstalk::Connection.new(host) | |
tubes = B.list_tubes | |
if ARGV.length > 0 && ARGV[0] == 'config' | |
puts %(graph_category Beanstalk | |
graph_title Beanstalk Tubes #{stat.split('_').map{|w| w.capitalize}.join(' ') } | |
#{tubes.map {|tube| "graph_vlabel #{tube}\n#{tube}.label #{tube}" }.join("\n")}) | |
exit(0) | |
end | |
puts tubes.collect {|tube| "#{tube}.value #{B.stats_tube(tube)["current-#{stat.gsub('_', '-')}"]}" }.join("\n") |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'beanstalk-client' | |
host = ENV['host'] || 'localhost:11300' | |
stat = File.basename(__FILE__).split('_').last | |
# stat = 'watching' # watching jobs-reserve jobs-ready using jobs-buried waiting jobs-delayed jobs-urgen | |
B = Beanstalk::Connection.new(host) | |
tubes = B.list_tubes | |
if ARGV.length > 0 && ARGV[0] == 'config' | |
puts %(graph_category Beanstalk | |
graph_title Beanstalk Tubes #{stat.split('_').map{|w| w.capitalize}.join(' ') } | |
#{tubes.map {|tube| "graph_vlabel #{tube}\n#{tube}.label #{tube}" }.join("\n")}) | |
exit(0) | |
end | |
puts tubes.collect {|tube| "#{tube}.value #{B.stats_tube(tube)["current-#{stat.gsub('_', '-')}"]}" }.join("\n") |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'beanstalk-client' | |
host = ENV['host'] || 'localhost:11300' | |
stat = File.basename(__FILE__).split('_').last | |
# stat = 'watching' # watching jobs-reserve jobs-ready using jobs-buried waiting jobs-delayed jobs-urgen | |
B = Beanstalk::Connection.new(host) | |
tubes = B.list_tubes | |
if ARGV.length > 0 && ARGV[0] == 'config' | |
puts %(graph_category Beanstalk | |
graph_title Beanstalk Tubes #{stat.split('_').map{|w| w.capitalize}.join(' ') } | |
#{tubes.map {|tube| "graph_vlabel #{tube}\n#{tube}.label #{tube}" }.join("\n")}) | |
exit(0) | |
end | |
puts tubes.collect {|tube| "#{tube}.value #{B.stats_tube(tube)["current-#{stat.gsub('_', '-')}"]}" }.join("\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment