-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmain.cpp
More file actions
39 lines (30 loc) · 1.31 KB
/
main.cpp
File metadata and controls
39 lines (30 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "BenchmarkRunner.h"
#include <aws/core/Aws.h>
using namespace std;
// Create runner that uses C++ SDK's classic S3Client
std::unique_ptr<BenchmarkRunner> createSdkClassicClientRunner(const BenchmarkConfig &config);
// Create runner that uses C++ SDK's S3CrtClient
std::unique_ptr<BenchmarkRunner> createSdkCrtClientRunner(const BenchmarkConfig &config);
// Create runner that uses C++ SDK's transfer manager
std::unique_ptr<BenchmarkRunner> createSdkTransferManagerRunner(const BenchmarkConfig &config);
int main(int argc, char *argv[])
{
Aws::SDKOptions sdkOptions;
sdkOptions.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Error;
Aws::InitAPI(sdkOptions);
int exitCode = benchmarkRunnerMain(
argc,
argv,
[](string_view id, const BenchmarkConfig &config)
{
if (id == "sdk-cpp-tm-classic")
return createSdkTransferManagerRunner(config);
if (id == "sdk-cpp-client-classic")
return createSdkClassicClientRunner(config);
if (id == "sdk-cpp-client-crt")
return createSdkCrtClientRunner(config);
fail("Unsupported S3_CLIENT. Options are: sdk-cpp-tm-classic, sdk-cpp-client-classic, sdk-cpp-client-crt");
});
Aws::ShutdownAPI(sdkOptions);
return exitCode;
}