-
-
Save anonymous/fda2dbf56da396d4f29a 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_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