33# #
44# # This source file is part of the SwiftAWSLambdaRuntime open source project
55# #
6- # # Copyright (c) 2017-2018 Apple Inc. and the SwiftAWSLambdaRuntime project authors
6+ # # Copyright (c) 2017-2022 Apple Inc. and the SwiftAWSLambdaRuntime project authors
77# # Licensed under Apache License v2.0
88# #
99# # See LICENSE.txt for license information
@@ -27,6 +27,8 @@ if [[ $(uname -s) == "Linux" ]]; then
2727fi
2828
2929swift build -c release -Xswiftc -g
30+ swift build --package-path Examples/Echo -c release -Xswiftc -g
31+ swift build --package-path Examples/JSON -c release -Xswiftc -g
3032
3133cleanup () {
3234 kill -9 $server_pid
@@ -58,7 +60,7 @@ cold=()
5860export MAX_REQUESTS=1
5961for (( i= 0 ; i< $cold_iterations ; i++ )) ; do
6062 start=$( gdate +%s%N)
61- ./.build/release/StringSample
63+ ./Examples/Echo/ .build/release/MyLambda
6264 end=$( gdate +%s%N)
6365 cold+=( $(( $end - $start )) )
6466done
@@ -70,7 +72,7 @@ results+=( "$MODE, cold: $avg_cold (ns)" )
7072echo " running $MODE mode warm test"
7173export MAX_REQUESTS=$warm_iterations
7274start=$( gdate +%s%N)
73- ./.build/release/StringSample
75+ ./Examples/Echo/ .build/release/MyLambda
7476end=$( gdate +%s%N)
7577sum_warm=$(( $end - $start - $avg_cold )) # substract by avg cold since the first call is cold
7678avg_warm=$(( $sum_warm / ($warm_iterations - 1 )) ) # substract since the first call is cold
@@ -96,7 +98,7 @@ cold=()
9698export MAX_REQUESTS=1
9799for (( i= 0 ; i< $cold_iterations ; i++ )) ; do
98100 start=$( gdate +%s%N)
99- ./.build/release/CodableSample
101+ ./Examples/JSON/ .build/release/MyLambda
100102 end=$( gdate +%s%N)
101103 cold+=( $(( $end - $start )) )
102104done
@@ -108,7 +110,7 @@ results+=( "$MODE, cold: $avg_cold (ns)" )
108110echo " running $MODE mode warm test"
109111export MAX_REQUESTS=$warm_iterations
110112start=$( gdate +%s%N)
111- ./.build/release/CodableSample
113+ ./Examples/JSON/ .build/release/MyLambda
112114end=$( gdate +%s%N)
113115sum_warm=$(( $end - $start - $avg_cold )) # substract by avg cold since the first call is cold
114116avg_warm=$(( $sum_warm / ($warm_iterations - 1 )) ) # substract since the first call is cold
0 commit comments