Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • DefaultRateLimiter

Implements

Index

Constructors

constructor

Properties

Private beta

beta: number

Private currentCapacity

currentCapacity: number = 0

Private enabled

enabled: boolean = false

Private fillRate

fillRate: number

Private lastMaxRate

lastMaxRate: number = 0

Private lastThrottleTime

lastThrottleTime: number

Private lastTimestamp

lastTimestamp: number = 0

Private lastTxRateBucket

lastTxRateBucket: number

Private maxCapacity

maxCapacity: number

Private measuredTxRate

measuredTxRate: number = 0

Private minCapacity

minCapacity: number

Private minFillRate

minFillRate: number

Private requestCount

requestCount: number = 0

Private scaleConstant

scaleConstant: number

Private smooth

smooth: number

Private timeWindow

timeWindow: number = 0

Methods

Private acquireTokenBucket

  • acquireTokenBucket(amount: number): Promise<void>

Private calculateTimeWindow

  • calculateTimeWindow(): void

Private cubicSuccess

  • cubicSuccess(timestamp: number): number

Private cubicThrottle

  • cubicThrottle(rateToUse: number): number

Private enableTokenBucket

  • enableTokenBucket(): void

Private getCurrentTimeInSeconds

  • getCurrentTimeInSeconds(): number

Private getPrecise

  • getPrecise(num: number): number

getSendToken

  • getSendToken(): Promise<void>

Private refillTokenBucket

  • refillTokenBucket(): void

updateClientSendingRate

  • updateClientSendingRate(response: any): void

Private updateMeasuredRate

  • updateMeasuredRate(): void

Private updateTokenBucketRate

  • updateTokenBucketRate(newRate: number): void