Class: Cassandra::Utils::CLI::Base
- Inherits:
-
Object
- Object
- Cassandra::Utils::CLI::Base
show all
- Defined in:
- lib/cassandra/utils/cli/base.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
7
8
9
|
# File 'lib/cassandra/utils/cli/base.rb', line 7
def command
@command
end
|
#stdout ⇒ Object
Returns the value of attribute stdout.
7
8
9
|
# File 'lib/cassandra/utils/cli/base.rb', line 7
def stdout
@stdout
end
|
Instance Method Details
#cwd ⇒ Object
9
10
11
|
# File 'lib/cassandra/utils/cli/base.rb', line 9
def cwd
'/tmp'
end
|
#output ⇒ Object
21
22
23
|
# File 'lib/cassandra/utils/cli/base.rb', line 21
def output
raise NotImplementedError, 'Must implement this in a subclass'
end
|
#run! ⇒ Object
25
26
27
28
29
30
31
32
|
# File 'lib/cassandra/utils/cli/base.rb', line 25
def run!
runner
@command.run!
@stdout = @command.stdout
out = output
Utils::Statsd.new(metric_name).to_dd(out).push!
out
end
|
#runner ⇒ Object
17
18
19
|
# File 'lib/cassandra/utils/cli/base.rb', line 17
def runner
@command ||= DaemonRunner::ShellOut.new(command: command, cwd: cwd, timeout: timeout)
end
|
#timeout ⇒ Object
13
14
15
|
# File 'lib/cassandra/utils/cli/base.rb', line 13
def timeout
300
end
|