Skip to content

Commit

Permalink
Revert "recreate s3 client and sleep"
Browse files Browse the repository at this point in the history
This reverts commit 2c1a20b.
  • Loading branch information
waahm7 committed Jul 15, 2024
1 parent 8aab9d6 commit a4d04e7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions runners/s3-benchrunner-c/benchrunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <random>
#include <thread>
#include <vector>
#include <chrono>

#include <aws/auth/credentials.h>
#include <aws/common/string.h>
Expand Down Expand Up @@ -637,13 +636,14 @@ int main(int argc, char *argv[])
string region = argv[4];
double targetThroughputGbps = stod(argv[5]);

auto benchmark = Benchmark(config, bucket, region, targetThroughputGbps);
uint64_t bytesPerRun = config.bytesPerRun();

// Repeat benchmark until we exceed maxRepeatCount or maxRepeatSecs
std::vector<double> durations;
auto appStart = high_resolution_clock::now();
uint64_t bytesPerRun = config.bytesPerRun();
for (int runI = 0; runI < config.maxRepeatCount; ++runI)
{
auto benchmark = Benchmark(config, bucket, region, targetThroughputGbps);
auto runStart = high_resolution_clock::now();

benchmark.run();
Expand All @@ -655,9 +655,13 @@ int main(int argc, char *argv[])
printf("Run:%d Secs:%f Gb/s:%f\n", runI + 1, runSecs, bytesToGigabit(bytesPerRun) / runSecs);
fflush(stdout);

std::this_thread::sleep_for(std::chrono::seconds(30));
// break out if we've exceeded maxRepeatSecs
duration<double> appDurationSecs = high_resolution_clock::now() - appStart;
if (appDurationSecs >= 1s * config.maxRepeatSecs)
break;
}

printStats(bytesPerRun, durations);

return 0;
}

0 comments on commit a4d04e7

Please sign in to comment.