Skip to content

Commit cb340de

Browse files
authored
Fix performance test script (#264)
1 parent 81f8d27 commit cb340de

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

scripts/performance_test.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
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
2727
fi
2828

2929
swift 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

3133
cleanup() {
3234
kill -9 $server_pid
@@ -58,7 +60,7 @@ cold=()
5860
export MAX_REQUESTS=1
5961
for (( 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)) )
6466
done
@@ -70,7 +72,7 @@ results+=( "$MODE, cold: $avg_cold (ns)" )
7072
echo "running $MODE mode warm test"
7173
export MAX_REQUESTS=$warm_iterations
7274
start=$(gdate +%s%N)
73-
./.build/release/StringSample
75+
./Examples/Echo/.build/release/MyLambda
7476
end=$(gdate +%s%N)
7577
sum_warm=$(($end-$start-$avg_cold)) # substract by avg cold since the first call is cold
7678
avg_warm=$(($sum_warm/($warm_iterations-1))) # substract since the first call is cold
@@ -96,7 +98,7 @@ cold=()
9698
export MAX_REQUESTS=1
9799
for (( 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)) )
102104
done
@@ -108,7 +110,7 @@ results+=( "$MODE, cold: $avg_cold (ns)" )
108110
echo "running $MODE mode warm test"
109111
export MAX_REQUESTS=$warm_iterations
110112
start=$(gdate +%s%N)
111-
./.build/release/CodableSample
113+
./Examples/JSON/.build/release/MyLambda
112114
end=$(gdate +%s%N)
113115
sum_warm=$(($end-$start-$avg_cold)) # substract by avg cold since the first call is cold
114116
avg_warm=$(($sum_warm/($warm_iterations-1))) # substract since the first call is cold

scripts/soundness.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
1919

2020
function replace_acceptable_years() {
2121
# this needs to replace all acceptable forms with 'YEARS'
22-
sed -e 's/2017-2018/YEARS/' -e 's/2017-2020/YEARS/' -e 's/2017-2021/YEARS/' -e 's/2020-2021/YEARS/' -e 's/2019/YEARS/' -e 's/2020/YEARS/' -e 's/2021/YEARS/' -e 's/2022/YEARS/'
22+
sed -e 's/2017-2018/YEARS/' -e 's/2017-2020/YEARS/' -e 's/2017-2021/YEARS/' -e 's/2017-2022/YEARS/' -e 's/2020-2021/YEARS/' -e 's/2019/YEARS/' -e 's/2020/YEARS/' -e 's/2021/YEARS/' -e 's/2022/YEARS/'
2323
}
2424

2525
printf "=> Checking for unacceptable language... "

0 commit comments

Comments
 (0)