File tree Expand file tree Collapse file tree 8 files changed +24
-14
lines changed
benchmarks/wrappers/aws/cpp Expand file tree Collapse file tree 8 files changed +24
-14
lines changed Original file line number Diff line number Diff line change
1
+ #include < chrono>
2
+ #include < cstdlib>
1
3
2
4
#include < aws/core/Aws.h>
3
5
#include < aws/lambda-runtime/runtime.h>
@@ -36,10 +38,6 @@ aws::lambda_runtime::invocation_response handler(aws::lambda_runtime::invocation
36
38
Aws::Utils::Json::JsonValue body;
37
39
body.WithObject (" result" , ret);
38
40
39
- // Switch cold execution after the first one.
40
- if (cold_execution)
41
- cold_execution = false ;
42
-
43
41
auto b = std::chrono::duration_cast<std::chrono::microseconds>(begin.time_since_epoch ()).count () / 1000.0 / 1000.0 ;
44
42
auto e = std::chrono::duration_cast<std::chrono::microseconds>(end.time_since_epoch ()).count () / 1000.0 / 1000.0 ;
45
43
body.WithDouble (" begin" , b);
@@ -50,6 +48,10 @@ aws::lambda_runtime::invocation_response handler(aws::lambda_runtime::invocation
50
48
body.WithString (" container_id" , container_id);
51
49
body.WithString (" cold_start_var" , cold_start_var);
52
50
51
+ // Switch cold execution after the first one.
52
+ if (cold_execution)
53
+ cold_execution = false ;
54
+
53
55
Aws::Utils::Json::JsonValue final_result;
54
56
final_result.WithObject (" body" , body);
55
57
return aws::lambda_runtime::invocation_response::success (final_result.View ().WriteReadable (), " application/json" );
Original file line number Diff line number Diff line change 1
1
2
- #include < memory>
2
+ #include < chrono>
3
+ #include < thread>
3
4
4
5
#include < aws/core/auth/AWSCredentialsProvider.h>
5
6
#include < aws/core/client/ClientConfiguration.h>
Original file line number Diff line number Diff line change 1
1
2
+ #include < chrono>
3
+ #include < iostream>
2
4
#include < string>
5
+ #include < thread>
3
6
4
7
#include < aws/core/Aws.h>
5
8
Original file line number Diff line number Diff line change 1
1
2
2
#include < memory>
3
+ #include < iostream>
4
+ #include < sstream>
3
5
4
6
#include < aws/core/auth/AWSCredentialsProvider.h>
5
7
#include < aws/core/client/ClientConfiguration.h>
13
15
14
16
Storage Storage::get_client () {
15
17
Aws::Client::ClientConfiguration config;
16
- // config.region = "eu-central-1";
17
18
config.caFile = " /etc/pki/tls/certs/ca-bundle.crt" ;
18
19
19
- std::cout << std::getenv (" AWS_REGION" ) << std::endl;
20
-
21
20
char const TAG[] = " LAMBDA_ALLOC" ;
22
21
auto credentialsProvider =
23
22
Aws::MakeShared<Aws::Auth::EnvironmentAWSCredentialsProvider>(TAG);
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ ENV WORKERS=${WORKERS}
5
5
6
6
7
7
RUN yum install -y cmake3 curl libcurl libcurl-devel git gcc gcc-c++ make tar gzip
8
- RUN git clone https://github.com/awslabs/aws-lambda-cpp.git\
8
+ RUN git clone --branch v0.2.10 https://github.com/awslabs/aws-lambda-cpp.git\
9
9
&& cmake3 -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/opt -B aws-lambda-cpp/build -S aws-lambda-cpp\
10
10
&& cmake3 --build aws-lambda-cpp/build --parallel ${WORKERS} --target install
11
11
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ ARG WORKERS
4
4
ENV WORKERS=${WORKERS}
5
5
6
6
RUN yum install -y cmake3 curl libcurl libcurl-devel git gcc gcc-c++ make zlib-devel openssl-devel
7
- RUN git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp.git\
7
+ RUN git clone --recurse-submodules --branch 1.11.590 https://github.com/aws/aws-sdk-cpp.git\
8
8
&& cd aws-sdk-cpp && mkdir build && cd build\
9
9
&& cmake3 -DCMAKE_BUILD_TYPE=Release -DBUILD_ONLY="s3;dynamodb;sqs" -DENABLE_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/opt/ ..\
10
10
&& cmake3 --build . --parallel ${WORKERS} --target install
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
mkdir -p /mnt/function/build
4
- cmake3 -DCMAKE_BUILD_TYPE=Release -S /mnt/function/ -B /mnt/function/build > /mnt/function/build/configuration.log
5
- VERBOSE=1 cmake3 --build /mnt/function/build --target aws-lambda-package-benchmark > /mnt/function/build/compilation.log
6
-
4
+ cmake3 -DCMAKE_BUILD_TYPE=Release -S /mnt/function/ -B /mnt/function/build > /mnt/function/build/configuration.log || {
5
+ echo " CMake configuration failed. Check configuration.log for details." >&2
6
+ exit 1
7
+ }
8
+ VERBOSE=1 cmake3 --build /mnt/function/build --target aws-lambda-package-benchmark > /mnt/function/build/compilation.log || {
9
+ echo " CMake build failed. Check compilation.log for details." >&2
10
+ exit 1
11
+ }
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ def deserialize(val: str) -> Language:
32
32
for member in Language :
33
33
if member .value == val :
34
34
return member
35
- raise Exception (f"Unknown language type { member } " )
35
+ raise Exception (f"Unknown language type { val } " )
36
36
37
37
38
38
class NoSQLStorage (str , Enum ):
You can’t perform that action at this time.
0 commit comments