Sha256: 77eec2aae3d9cda8e12ab45257b62074316e55c8337177780f87a2fc0715d20f
Contents?: true
Size: 952 Bytes
Versions: 2
Compression:
Stored size: 952 Bytes
Contents
require 'mixlib/shellout' require 'statsd' module Cassandra module Utils module CLI class Base attr_reader :command, :stdout def cwd '/tmp' end def timeout 15 end def runner @command ||= Mixlib::ShellOut.new(command, :cwd => cwd, :timeout => timeout) end def output raise NotImplementedError, 'Must implement this in a subclass' end def run! runner @command.run_command @command.error! @stdout = @command.stdout out = output push_metric(out) out end protected def statsd @statsd ||= ::Statsd.new('localhost', 8125) end def push_metric(value) statsd.gauge(metric_name, value) end def to_dd(out) out == true ? 1 : 0 end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
cassandra-utils-0.2.1 | lib/cassandra/utils/cli/base.rb |
cassandra-utils-0.0.1 | lib/cassandra/utils/cli/base.rb |