forked from rapid7/cassandra-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase.rb
More file actions
36 lines (30 loc) · 693 Bytes
/
base.rb
File metadata and controls
36 lines (30 loc) · 693 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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: command, cwd: cwd, timeout: timeout)
end
def output
raise NotImplementedError, 'Must implement this in a subclass'
end
def run!
runner
@command.run!
@stdout = @command.stdout
out = output
Utils::Statsd.new(metric_name).to_dd(out).push!
out
end
end
end
end
end