Skip to content

Commit 86a801f

Browse files
committed
fix errors
1 parent 25e34b5 commit 86a801f

File tree

3 files changed

+22
-25
lines changed

3 files changed

+22
-25
lines changed

scripts/integration_tests.sh

100644100755
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,10 @@ fatal() { error "$@"; exit 1; }
2222
test -n "${SWIFT_VERSION:-}" || fatal "SWIFT_VERSION unset"
2323
test -n "${COMMAND:-}" || fatal "COMMAND unset"
2424
test -n "${EXAMPLE:-}" || fatal "EXAMPLE unset"
25-
swift_version="$SWIFT_VERSION"
26-
command="$COMMAND"
27-
example="$EXAMPLE"
2825

29-
pushd Examples/"$example" > /dev/null
26+
pushd Examples/"$EXAMPLE" > /dev/null
3027

3128
log "Running command with Swift $SWIFT_VERSION"
32-
eval "$command"
29+
eval "$COMMAND"
3330

3431
popd

scripts/linux_performance_setup.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ apt-get install -y vim htop strace linux-tools-common linux-tools-generic libc6-
2020

2121
echo 0 > /proc/sys/kernel/kptr_restrict
2222

23-
cd /usr/bin
23+
pushd /usr/bin
2424
rm -rf perf
2525
ln -s /usr/lib/linux-tools/*/perf perf
26-
cd -
26+
popd
2727

28-
cd /opt
28+
pushd /opt
2929
git clone https://github.com/brendangregg/FlameGraph.git
30-
cd -
30+
popd
3131

3232
# build the code in relase mode with debug symbols
3333
# swift build -c release -Xswiftc -g

scripts/performance_test.sh

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +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
30+
LAMBDA_USE_LOCAL_DEPS=../.. swift build --package-path Examples/HelloWorld -c release -Xswiftc -g
31+
LAMBDA_USE_LOCAL_DEPS=../.. swift build --package-path Examples/HelloJSON -c release -Xswiftc -g
3232

3333
cleanup() {
3434
kill -9 $server_pid # ignore-unacceptable-language
@@ -58,24 +58,24 @@ kill -0 $server_pid # check server is alive # ignore-unacceptable-language
5858
echo "running $MODE mode cold test"
5959
cold=()
6060
export MAX_REQUESTS=1
61-
for (( i=0; i<$cold_iterations; i++ )); do
61+
for (( i=0; i<cold_iterations; i++ )); do
6262
start=$(gdate +%s%N)
63-
./Examples/Echo/.build/release/MyLambda
63+
./Examples/HelloWorld/.build/release/MyLambda
6464
end=$(gdate +%s%N)
65-
cold+=( $(($end-$start)) )
65+
cold+=( $((end-start)) )
6666
done
6767
sum_cold=$(IFS=+; echo "$((${cold[*]}))")
68-
avg_cold=$(($sum_cold/$cold_iterations))
68+
avg_cold=$((sum_cold/cold_iterations))
6969
results+=( "$MODE, cold: $avg_cold (ns)" )
7070

7171
# normal calls
7272
echo "running $MODE mode warm test"
7373
export MAX_REQUESTS=$warm_iterations
7474
start=$(gdate +%s%N)
75-
./Examples/Echo/.build/release/MyLambda
75+
./Examples/HelloWorld/.build/release/MyLambda
7676
end=$(gdate +%s%N)
77-
sum_warm=$(($end-$start-$avg_cold)) # substract by avg cold since the first call is cold
78-
avg_warm=$(($sum_warm/($warm_iterations-1))) # substract since the first call is cold
77+
sum_warm=$((end-start-avg_cold)) # substract by avg cold since the first call is cold
78+
avg_warm=$((sum_warm/(warm_iterations-1))) # substract since the first call is cold
7979
results+=( "$MODE, warm: $avg_warm (ns)" )
8080

8181
#------------------
@@ -98,30 +98,30 @@ cold=()
9898
export MAX_REQUESTS=1
9999
for (( i=0; i<$cold_iterations; i++ )); do
100100
start=$(gdate +%s%N)
101-
./Examples/JSON/.build/release/MyLambda
101+
./Examples/HelloJSON/.build/release/MyLambda
102102
end=$(gdate +%s%N)
103-
cold+=( $(($end-$start)) )
103+
cold+=( $((end-start)) )
104104
done
105105
sum_cold=$(IFS=+; echo "$((${cold[*]}))")
106-
avg_cold=$(($sum_cold/$cold_iterations))
106+
avg_cold=$((sum_cold$cold_iterations))
107107
results+=( "$MODE, cold: $avg_cold (ns)" )
108108

109109
# normal calls
110110
echo "running $MODE mode warm test"
111111
export MAX_REQUESTS=$warm_iterations
112112
start=$(gdate +%s%N)
113-
./Examples/JSON/.build/release/MyLambda
113+
./Examples/HelloJSON/.build/release/MyLambda
114114
end=$(gdate +%s%N)
115-
sum_warm=$(($end-$start-$avg_cold)) # substract by avg cold since the first call is cold
116-
avg_warm=$(($sum_warm/($warm_iterations-1))) # substract since the first call is cold
115+
sum_warm=$((end-$start-avg_cold)) # substract by avg cold since the first call is cold
116+
avg_warm=$((sum_warm/(warm_iterations-1))) # substract since the first call is cold
117117
results+=( "$MODE, warm: $avg_warm (ns)" )
118118

119119
# print results
120120
echo "-----------------------------"
121121
echo "results"
122122
echo "-----------------------------"
123123
for i in "${results[@]}"; do
124-
echo $i
124+
echo "$i"
125125
done
126126
echo "-----------------------------"
127127

0 commit comments

Comments
 (0)