With stress testing being implemented soon, there needs to be some configurations made for the project to allow tests to be able to run without having to rebuild the entire project just to disable or enable some functionality of the project.
For example, in Server.cpp we have the following block of code:
|
// Check rate limit |
|
if (!rt.isAllowed(clientIP)) |
|
{ |
|
std::cout << "[RATELIMIT] Blocked IP: " << clientIP << "\n"; |
|
CloseSocket(AcceptSocket); |
|
continue; |
|
} |
It would be ideal if we could edit the rate-limiting feature without rebuilding. I have been thinking about using Docker arguments like this:
docker run -d -p 6625:6625 -e KV_DISABLE_RATE_LIMIT=1 --name kv-test kv-db:latest
The possible solution that I got is this
disableRateLimit = std::getenv("KV_DISABLE_RATE_LIMIT") != nullptr;
Need to figure out where to use it and how to use it prob server, and when the check happens for rate limiting, we also check for disableRateLimit
With stress testing being implemented soon, there needs to be some configurations made for the project to allow tests to be able to run without having to rebuild the entire project just to disable or enable some functionality of the project.
For example, in
Server.cppwe have the following block of code:KV-Database/src/Server/Server.cpp
Lines 96 to 102 in 8dc2c17
It would be ideal if we could edit the rate-limiting feature without rebuilding. I have been thinking about using Docker arguments like this:
The possible solution that I got is this
Need to figure out where to use it and how to use it prob server, and when the check happens for rate limiting, we also check for
disableRateLimit