#include <aws/core/utils/Outcome.h>
#include <aws_common/sdk_utils/throttling_manager.h>
#include <gtest/gtest.h>
#include <atomic>
#include <thread>
#include <cmath>
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
void | MakeCalls (ThrottledClient *throttled_client, std::chrono::milliseconds duration, std::chrono::microseconds sleep_duration) |
|
| TEST (ThrottlingManagerTest, simpleThrottling) |
|
| TEST (ThrottlingManagerTest, multiThreadedClientThrottling) |
|
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
void MakeCalls |
( |
ThrottledClient * |
throttled_client, |
|
|
std::chrono::milliseconds |
duration, |
|
|
std::chrono::microseconds |
sleep_duration |
|
) |
| |
Thread routine. Calls the client's API for the duration specified, sleeping in between calls.
- See also
- multiThreadedClientThrottling test case
Definition at line 89 of file throttling_manager_test.cpp.
TEST |
( |
ThrottlingManagerTest |
, |
|
|
simpleThrottling |
|
|
) |
| |
TEST |
( |
ThrottlingManagerTest |
, |
|
|
multiThreadedClientThrottling |
|
|
) |
| |
Spawns multiple threads which call the throttled function & verifies that no more than max_tps calls reached the downstream client.
Definition at line 113 of file throttling_manager_test.cpp.