algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
algotradelib::network::RateLimitStats Struct Reference

A rate limiter's counters per traffic class, its current budget, and the broker's refusals (from RateLimitController::stats). More...

#include <algotradelib/src/network/rate_limit.hpp>

Collaboration diagram for algotradelib::network::RateLimitStats:

Public Member Functions

RateLimitGroupStats & group (RateLimitGroup value)
 Returns the counters for one traffic class.
const RateLimitGroupStats & group (RateLimitGroup value) const
 Returns the counters for one traffic class.

Public Attributes

RateLimitGroupStats groups_ [rate_limit_group_count]
 The counters per traffic class; read them with group().
int burst_ {0}
 The burst in force.
int per_second_ {0}
 The sustained rate in force.
int available_ {0}
 How much of the burst was unspent just after the last admitted request (for that request's class); not updated otherwise.
std::uint64_t broker_rejections_ {0}
 How many rate-limit refusals the broker sent; if it keeps rising, lower the budget.

Detailed Description

A rate limiter's counters per traffic class, its current budget, and the broker's refusals (from RateLimitController::stats).

Definition at line 359 of file rate_limit.hpp.

Member Function Documentation

◆ group() [1/2]

RateLimitGroupStats & algotradelib::network::RateLimitStats::group ( RateLimitGroup value)
inline

Returns the counters for one traffic class.

Parameters
valueThe class.
Returns
The counters.

Definition at line 376 of file rate_limit.hpp.

◆ group() [2/2]

const RateLimitGroupStats & algotradelib::network::RateLimitStats::group ( RateLimitGroup value) const
inline

Returns the counters for one traffic class.

Parameters
valueThe class.
Returns
The counters.

Definition at line 385 of file rate_limit.hpp.

Member Data Documentation

◆ available_

int algotradelib::network::RateLimitStats::available_ {0}

How much of the burst was unspent just after the last admitted request (for that request's class); not updated otherwise.

Definition at line 367 of file rate_limit.hpp.

◆ broker_rejections_

std::uint64_t algotradelib::network::RateLimitStats::broker_rejections_ {0}

How many rate-limit refusals the broker sent; if it keeps rising, lower the budget.

Definition at line 369 of file rate_limit.hpp.

◆ burst_

int algotradelib::network::RateLimitStats::burst_ {0}

The burst in force.

Definition at line 363 of file rate_limit.hpp.

◆ groups_

RateLimitGroupStats algotradelib::network::RateLimitStats::groups_[rate_limit_group_count]

The counters per traffic class; read them with group().

Definition at line 361 of file rate_limit.hpp.

Referenced by group(), and group().

◆ per_second_

int algotradelib::network::RateLimitStats::per_second_ {0}

The sustained rate in force.

Definition at line 365 of file rate_limit.hpp.


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