Module: Ruboty::SqsMonitor

Defined in:
lib/ruboty/sqs_monitor.rb,
lib/ruboty/sqs_monitor/aws/sqs.rb,
lib/ruboty/sqs_monitor/version.rb,
lib/ruboty/sqs_monitor/actions/add.rb,
lib/ruboty/sqs_monitor/actions/base.rb,
lib/ruboty/sqs_monitor/actions/list.rb,
lib/ruboty/sqs_monitor/actions/state.rb,
lib/ruboty/sqs_monitor/actions/delete.rb,
lib/ruboty/sqs_monitor/aws/cloudwatch.rb,
lib/ruboty/sqs_monitor/actions/state_trend.rb

Defined Under Namespace

Modules: Actions, Aws

Constant Summary collapse

NAMESPACE =
"sqs_monitor"
VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.cloudwatch(sqs_name, start_time = nil, end_time = nil) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/ruboty/sqs_monitor.rb', line 14

def cloudwatch(sqs_name, start_time=nil, end_time=nil)
  options = sdk_options.merge(
    start_time: start_time,
    end_time:   end_time,
  )
  Aws::CloudWatch.new(sqs_name, options)
end

.metricsObject



22
23
24
# File 'lib/ruboty/sqs_monitor.rb', line 22

def metrics
  (ENV["SQS_METRICS"] || DEFAULT_METRICS).split(/,/)
end

.sqs(name) ⇒ Object



10
11
12
# File 'lib/ruboty/sqs_monitor.rb', line 10

def sqs(name)
  Aws::Sqs.new(name, sdk_options)
end

.trend_separatorObject



26
27
28
# File 'lib/ruboty/sqs_monitor.rb', line 26

def trend_separator
  ENV["SQS_TREND_SEPARATOR"] || " "
end