Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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