Skip to content

Commit e508fc4

Browse files
authored
Add OLP server start before running perf test (#1241)
Add Disk i/o measurements: toral written mb. Enable measuremnts collection in python script. Add new bash script which: - start olp mock server - verify it's started - start performance test execution. Currently test is running without olp server. Relates-To: OLPEDGE-1771 Signed-off-by: Yaroslav Stefinko <[email protected]>
1 parent 3916495 commit e508fc4

File tree

4 files changed

+61
-4
lines changed

4 files changed

+61
-4
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ weekly_perf_reports:
3737
script:
3838
- mkdir -p reports .public
3939
- $CI_PROJECT_DIR/scripts/linux/weekly/gitlab_build_perf_tests.sh
40-
- python3 $CI_PROJECT_DIR/scripts/linux/weekly/run_performance_test_metrics.py
40+
- $CI_PROJECT_DIR/scripts/linux/weekly/gitlab_run_perf_test_metrics.sh
4141
- cat $CI_PROJECT_DIR/scripts/linux/weekly/reports/index.html >> .public/index.html && cat $CI_PROJECT_DIR/scripts/linux/weekly/performance_tests.json >> .public/performance_tests.json
4242
- if $(ls $CI_PROJECT_DIR/reports/*.xml &>/dev/null); then tar -czvf ${CI_JOB_NAME}_test_reports.tar.gz $CI_PROJECT_DIR/reports ; fi;
4343
- $CI_PROJECT_DIR/scripts/misc/artifactory_upload.sh edge-sdks/sdk-for-cpp/releases/test-reports/$CI_JOB_NAME/$CI_JOB_ID/${CI_JOB_NAME}_test_reports.tar.gz $CI_PROJECT_DIR/${CI_JOB_NAME}_test_reports.tar.gz
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash -ex
2+
#
3+
# Copyright (C) 2021 HERE Europe B.V.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# SPDX-License-Identifier: Apache-2.0
18+
# License-Filename: LICENSE
19+
20+
# Script run olp-cpp-sdk-performance-tests with metrics collecting
21+
22+
# For core dump backtrace
23+
ulimit -c unlimited
24+
25+
# Start local server
26+
node tests/utils/olp_server/server.js & export SERVER_PID=$!
27+
28+
# Node can start server in 1 second, but not faster.
29+
# Add waiter for server to be started. No other way to solve that.
30+
# Curl returns code 1 - means server still down. Curl returns 0 when server is up
31+
RC=1
32+
while [[ ${RC} -ne 0 ]];
33+
do
34+
set +e
35+
curl -s http://localhost:3000
36+
RC=$?
37+
sleep 0.2
38+
set -e
39+
done
40+
echo ">>> Local Server started for further performance test ... >>>"
41+
42+
# Measure Disk I/O and CPU/RAM
43+
# Run test with metrics collector
44+
python3 $CI_PROJECT_DIR/scripts/linux/weekly/run_performance_test_metrics.py
45+
46+
# Terminate the OLP server
47+
kill -TERM $SERVER_PID
48+
49+
wait

scripts/linux/weekly/performance_tests.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"max_mem",
1010
"avg_mem",
1111
"max_cpu",
12-
"avg_cpu"
12+
"avg_cpu",
13+
"total_written_to_disk_bytes"
1314
]
1415
}
1516
],
@@ -33,6 +34,13 @@
3334
{"Maximum": "max_mem"},
3435
{"Average": "avg_mem"}
3536
]
37+
},
38+
{
39+
"name": "Disk usage",
40+
"units": "MB",
41+
"values": [
42+
{"Total": "total_written_to_disk_mb"}
43+
]
3644
}
3745
]
3846
}

scripts/linux/weekly/run_performance_test_metrics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ def main():
292292
all_metrics = {}
293293
calculate_cpu_and_memory(args.test_exec, test_infos, all_metrics)
294294

295-
# Needed for more complicated measurements in future
296-
#run_all_tests(args.test_exec, test_infos, all_metrics)
295+
# Needed for more complicated measurements which are collected in tests itself
296+
run_all_tests(args.test_exec, test_infos, all_metrics)
297297

298298
pprint.pprint(all_metrics)
299299

0 commit comments

Comments
 (0)