Skip to content

Instantly share code, notes, and snippets.

Created June 7, 2013 13:33
Show Gist options
  • Save anonymous/fda2dbf56da396d4f29a to your computer and use it in GitHub Desktop.
Save anonymous/fda2dbf56da396d4f29a to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require_relative 'lib/flume/metrics'
require 'trollop'
opts = Trollop.options do
opt :warn, "Warning threshold", :type => Integer, :default => 100
opt :crit, "Critical threshold", :type => Integer, :default => 1000
opt :url, "Flume end point", :type => String, :default => "http://localhost:8080/metrics"
end
def channel_sizes(metrics)
metrics.channels.each do |channel|
channel.attribute('ChannelSize')
end
end
metrics = Flume::Metrics.new(opts[:url])
max_channel_size = channel_sizes.max
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment