Skip to main content
Version: 3.28.0

RateCounter.prototype.lookupCount

Look up the current rate for the given entry and the given duration.

Syntax

lookupCount(entry, duration)

Parameters

  • entry : string
    • The name of the entry to look up
  • duration : number
    • The duration to lookup alongside the entry, has to be either, 10, 20, 30, 40, 50, or 60 seconds.

Return value

Returns a number which is the count for the given entry and duration in this RateCounter instance.

Exceptions

  • TypeError
    • Thrown if the provided entry value can not be coerced into a string
    • Thrown if the provided duration value is not either, 10, 20, 30, 40, 50 or 60.