SlidingWindowThrottle ClassNFX Class Library

[This is preliminary documentation and is subject to change.]

Efficiently calculates the throttling rate over a number of seconds. The algorithm implements a variation of token bucket algorithm that doesn't require to add tokens to the bucket on a timer but rather it maintains a cirtular buffer of tokens with resolution of 1/BucketsPerSec. The Add() function is used to add items to a bucket associated with the timestamp passed as the first argument to the function. The Sum() returns the total number of items over the given interval of seconds. The items automatically expire when the time moves on the successive invocations of the Add() method.
Inheritance Hierarchy

OnlineSystem Object
  NFX DisposableObject
    NFX.ApplicationModel ApplicationComponent
      NFX.Throttling Throttle
        NFX.Throttling SlidingWindowThrottle

Namespace: NFX.Throttling
Assembly: NFX (in NFX.dll) Version: 3.0.0.1 (3.0.0.1)
Syntax

public class SlidingWindowThrottle : Throttle
See Also