Sha256: cf5757f2e17a01d50a24e1516b73301035031caa58a689cfcce77eed10f85b97

Contents?: true

Size: 971 Bytes

Versions: 2

Compression:

Stored size: 971 Bytes

Contents

require_relative "../request"

module Freno
  class Client
    module Requests
      class CheckRead < Request

        def initialize(**kwargs)
          super

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

          check do
            present app: app, store_type: store_type, store_name: store_name, threshold: threshold
          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-read/#{app}/#{store_type}/#{store_name}/#{threshold.to_f.round(3)}"
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
freno-client-0.8.1 lib/freno/client/requests/check_read.rb
freno-client-0.8.0 lib/freno/client/requests/check_read.rb