Created
October 16, 2012 09:50
-
-
Save ChrisLundquist/3898403 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def get_rrd_backend | |
Visage::Collectd::RRD.new( :rrddir => Visage::Config.rrddir, | |
:collectdsock => Visage::Config.collectdsock, | |
:rrdcachedsock => Visage::Config.rrdcachedsock) | |
end | |
def get_foo_backend | |
# something else | |
end | |
def get_current_backend | |
# when the config file options says :backend => :rrd | |
get_rrd_backend() | |
# When the config file says :backend => :foo | |
get_foo_backend() | |
# else misconfiguration or unknown backend, raise "unknown backend" | |
end | |
json = get_current_backend.json( | |
:host => host, | |
:plugin => plugin, | |
:instances => instances, | |
:start => start, | |
:finish => finish, | |
:percentiles => percentiles, | |
:resolution => resolution) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment