Class: Labkit::RateLimit::Result::Info

Inherits:
Data
  • Object
show all
Defined in:
lib/labkit/rate_limit/result.rb

Overview

Per-window counter data attached to a matched Result. resolved_limit - the evaluated limit Integer for this rule resolved_period - the evaluated period Integer (seconds) for this rule count - the post-increment counter value as a Float; integer-valued

for default cost=1 callers, fractional for cost-mode callers.
Pre-2.x releases exposed this as Integer; see the migration
note in the cost-aware Lua script change.

remaining - requests remaining before the limit is hit (floors at 0).

Inherits Float typing from count when count is fractional.

reset_at - best-effort UTC Time when the counter window resets

Instance Attribute Summary collapse

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count

Returns:

  • (Object)

    the current value of count



59
60
61
# File 'lib/labkit/rate_limit/result.rb', line 59

def count
  @count
end

#remainingObject (readonly)

Returns the value of attribute remaining

Returns:

  • (Object)

    the current value of remaining



59
60
61
# File 'lib/labkit/rate_limit/result.rb', line 59

def remaining
  @remaining
end

#reset_atObject (readonly)

Returns the value of attribute reset_at

Returns:

  • (Object)

    the current value of reset_at



59
60
61
# File 'lib/labkit/rate_limit/result.rb', line 59

def reset_at
  @reset_at
end

#resolved_limitObject (readonly)

Returns the value of attribute resolved_limit

Returns:

  • (Object)

    the current value of resolved_limit



59
60
61
# File 'lib/labkit/rate_limit/result.rb', line 59

def resolved_limit
  @resolved_limit
end

#resolved_periodObject (readonly)

Returns the value of attribute resolved_period

Returns:

  • (Object)

    the current value of resolved_period



59
60
61
# File 'lib/labkit/rate_limit/result.rb', line 59

def resolved_period
  @resolved_period
end