RateCounter()
The RateCounter
constructor can be used with a Edge Rate Limiter or standalone for counting and rate calculations.
Note: Can only be used when processing requests, not during build-time initialization.
Syntax
new RateCounter(name)
Note:
RateCounter()
can only be constructed withnew
. Attempting to call it withoutnew
throws aTypeError
.
Parameters
name
: string- Open a RateCounter with the given name
Return value
A new RateCounter
object instance.
Exceptions
TypeError
- Thrown if the provided
name
value can not be coerced into a string
- Thrown if the provided