Sha256: f34dac4c560be5a1ab17d1d2dd5cab36bfd28a1847ff32c996ab0c9328bf38c0

Contents?: true

Size: 723 Bytes

Versions: 1

Compression:

Stored size: 723 Bytes

Contents

require 'daemon_runner/shell_out'

module Cassandra
  module Utils
    module CLI
      class Base
        attr_reader :command, :stdout

        def cwd
          '/tmp'
        end

        def timeout
          300
        end

        def runner
          @command ||= DaemonRunner::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
          Utils::Statsd.new(metric_name).to_dd(out).push!
          out
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cassandra-utils-0.3.1.pre.beta.2 lib/cassandra/utils/cli/base.rb