Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: '3.9' # default version on Amazon Linux 2023
python-version: '3.10' # boto3 develop branch requires >=3.10

- uses: actions/setup-java@v3
with:
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: '3.9' # default version on Amazon Linux 2023
python-version: '3.10' # boto3 develop branch requires >=3.10

- run: python -m pip install -r scripts/requirements.txt

Expand Down
19 changes: 19 additions & 0 deletions runners/s3-benchrunner-c/BenchmarkRunner.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "BenchmarkRunner.h"

#include <algorithm>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <random>
Expand Down Expand Up @@ -182,6 +183,22 @@ BenchmarkRunner::BenchmarkRunner(const BenchmarkConfig &config) : config(config)

BenchmarkRunner::~BenchmarkRunner() = default;

void BenchmarkRunner::prepareRun()
{
// Delete downloaded files before each run, so the next run starts fresh.
for (auto &&task : config.tasks)
{
if (task.action == "download" && config.filesOnDisk)
{
filesystem::path filePath(task.key);
if (filesystem::exists(filePath))
{
filesystem::remove(filePath);
}
}
}
}

// If telemetry is enabled, output stats for each run to ./telemetry/<workload_name>/<current_date_time>/stats.txt
FILE *statsFile = NULL;

Expand Down Expand Up @@ -362,6 +379,8 @@ int benchmarkRunnerMain(int argc, char *argv[], const CreateRunnerFromNameFn &cr
auto appStart = high_resolution_clock::now();
for (int runNumber = 1; runNumber <= config.maxRepeatCount; ++runNumber)
{
benchmark->prepareRun();

auto runStart = high_resolution_clock::now();

benchmark->run(runNumber);
Expand Down
3 changes: 3 additions & 0 deletions runners/s3-benchrunner-c/BenchmarkRunner.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ class BenchmarkRunner
BenchmarkRunner(const BenchmarkRunner &) = delete;
BenchmarkRunner &operator=(const BenchmarkRunner &) = delete;

// Preparation work between runs (e.g. delete downloaded files so next run starts fresh)
virtual void prepareRun();

// A benchmark can be run repeatedly
virtual void run(size_t runNumber) = 0;
};
Expand Down
Loading