Class: Freno::Client::Requests::Check

Inherits:
Freno::Client::Request show all
Defined in:
lib/freno/client/requests/check.rb

Direct Known Subclasses

ReplicationDelay

Constant Summary

Constants included from Preconditions

Preconditions::PreconditionNotMet

Instance Attribute Summary

Attributes inherited from Freno::Client::Request

#args, #faraday, #options, #raise_on_timeout

Instance Method Summary collapse

Methods inherited from Freno::Client::Request

perform, #perform

Methods included from Preconditions

check

Constructor Details

#initialize(**kwargs) ⇒ Check

Returns a new instance of Check.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/freno/client/requests/check.rb', line 9

def initialize(**kwargs)
  super

  app        = kwargs.fetch(:app)
  store_type = kwargs.fetch(:store_type)
  store_name = kwargs.fetch(:store_name)

  check do
    present app: app, store_type: store_type, store_name: store_name
  end

  # A low priority check is handled slightly differently by Freno. If
  # the p=low GET parameter is passed, the check will fail for any app
  # with failed checks within the last second. This failure is returned
  # quickly, without checking the underlying metric.
  params[:p] = "low" if options[:low_priority]

  @path = "check/#{app}/#{store_type}/#{store_name}"
end