Sha256: c2acb4d1f936aa1d3130a56a1092a645e32fa06cd49234e37e5058a230af1c1c

Contents?: true

Size: 1.06 KB

Versions: 4

Compression:

Stored size: 1.06 KB

Contents

class Jets::CLI::Concurrency
  class Get < Base
    def initialize(options = {})
      super
      function_name = Jets::CLI::Lambda::Lookup.function(@options[:function])
      @lambda_function = Jets::CLI::Lambda::Function.new(function_name)
    end

    def run
      puts <<~EOL
        Settings for Function: #{@lambda_function.name}
        Reserved concurrency: #{reserved_concurrency}
        Provisioned concurrency: #{provisioned_concurrency}
      EOL
    end

    def provisioned_concurrency
      info = @lambda_function.provisioned_concurrency_info

      if @lambda_function.provisioned_concurrency.nil?
        "not set"
      elsif info[:status] == "IN_PROGRESS"
        "#{info[:allocated]}/#{info[:requested]} (In progress)"
      else
        @lambda_function.provisioned_concurrency
      end
    end

    def reserved_concurrency
      if @lambda_function.reserved_concurrency.nil?
        "not set. Will scale to unreserved limit: #{account_limit.unreserved_concurrent_executions}"
      else
        @lambda_function.reserved_concurrency
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jets-6.0.5 lib/jets/cli/concurrency/get.rb
jets-6.0.4 lib/jets/cli/concurrency/get.rb
jets-6.0.3 lib/jets/cli/concurrency/get.rb
jets-6.0.2 lib/jets/cli/concurrency/get.rb