Commit eeba1214 authored by Nora Shoemaker's avatar Nora Shoemaker

Refactored seconds setting and worker space reservation

parent ce00c507
...@@ -1556,16 +1556,14 @@ int main(int argc, char **argv) { ...@@ -1556,16 +1556,14 @@ int main(int argc, char **argv) {
// if in rate mode, create a new worker each second // if in rate mode, create a new worker each second
else { else {
// set various config values // set various config values
config.seconds = std::min(n_time, c_time);
if ((int)config.nreqs < config.nconns) { if ((int)config.nreqs < config.nconns) {
config.seconds = c_time; config.seconds = c_time;
config.workers.reserve(config.seconds);
} else if (config.nconns == 0) { } else if (config.nconns == 0) {
config.seconds = n_time; config.seconds = n_time;
} else { } else {
config.workers.reserve(config.seconds); config.seconds = std::min(n_time, c_time);
} }
config.workers.reserve(config.seconds);
config.conns_remainder = config.nconns % config.rate; config.conns_remainder = config.nconns % config.rate;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment