Resource Tuner
Loading...
Searching...
No Matches
RateLimiter Class Reference

RateLimiter. More...

#include <RateLimiter.h>

Public Member Functions

int8_t isRateLimitHonored (int32_t clientTID)
 Checks if rate limit is honored.
 
int8_t isGlobalRateLimitHonored ()
 Checks if the Global Rate Limit is honored.
 

Detailed Description

RateLimiter.

Responsible for Tracking Client Behaviour, and Protect against System Abuse.

Definition at line 38 of file RateLimiter.h.

Member Function Documentation

◆ isGlobalRateLimitHonored()

int8_t RateLimiter::isGlobalRateLimitHonored ( )

Checks if the Global Rate Limit is honored.

Resource Tuner sets a cap on the number of Active Requests which can be served concurrently. If the current Count of Concurrent Active Requests hits this threshold, then any new Requests shall be dropped.

Returns
int8_t:
  • 1: If the Request can be accepted.
  • 0: otherwise

◆ isRateLimitHonored()

int8_t RateLimiter::isRateLimitHonored ( int32_t  clientTID)

Checks if rate limit is honored.

RateLimiter uses the notion of Client Health (initialize to 100), which changes based on Client Behaviour (through Reward or Punishment). If this value Reaches 0, then any further Requests from the Client shall be dropped.

Parameters
clientTIDTID of the client
Returns
int8_t:
  • 1: If the Request can be accepted.
  • 0: otherwise

The documentation for this class was generated from the following file: