Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 775 Bytes

File metadata and controls

32 lines (23 loc) · 775 Bytes
hide_title hide_table_of_contents pagination_next pagination_prev

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.