Skip to content

Commit 32066a1

Browse files
authored
Add perf test job with cpu/ram usage report (#1234)
Job runs build & performance test with cpu/ram usage reporting collected by python script. It measure max and avg values for CPU and RAM during execution of MemoryTest.ReadNPartitionsFromVersionedLayer/15m_test. Job is proposed to run weekly or on-demand for release. Report with collected data feom csv to be showed as index.html on Gitlab Pages. Relates-To: OLPEDGE-2459 Signed-off-by: Yaroslav Stefinko <[email protected]>
1 parent f1f5bd2 commit 32066a1

File tree

6 files changed

+724
-0
lines changed

6 files changed

+724
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ CMakeLists.txt.user
77
build*/
88
*.doap
99
.repo
10+
.cache
11+
.local
12+
.bash_history
1013

1114
# Compiled Object files
1215
*.slo

.gitlab-ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,33 @@ stages:
2323
- translate_report
2424
- deploy
2525

26+
# Job for running perf test with reports of mem/cpu usage
27+
weekly_perf_reports:
28+
stage: build
29+
image: ${DOCKER_REGISTRY}/${DOCKER_IMAGE_USER}:${DOCKER_IMAGE_USER_VERSION}
30+
only:
31+
refs:
32+
- branches
33+
- master
34+
- schedules
35+
variables:
36+
- $PERFORMANCE
37+
script:
38+
- mkdir -p reports .public
39+
- $CI_PROJECT_DIR/scripts/linux/weekly/gitlab_build_perf_tests.sh
40+
- python3 $CI_PROJECT_DIR/scripts/linux/weekly/run_performance_test_metrics.py
41+
- 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
42+
- if $(ls $CI_PROJECT_DIR/reports/*.xml &>/dev/null); then tar -czvf ${CI_JOB_NAME}_test_reports.tar.gz $CI_PROJECT_DIR/reports ; fi;
43+
- $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
44+
artifacts:
45+
when: always
46+
paths:
47+
- performance_results_*.csv
48+
- test_detail_perf.json
49+
- .public
50+
- reports/*.xml
51+
expire_in: 1 year
52+
2653
wv_security_job:
2754
stage: test
2855
tags:
@@ -231,6 +258,7 @@ pages:
231258
variables:
232259
- $FV
233260
- $NV
261+
- $PERFORMANCE
234262

235263
# TO DO: add Android network test into script $CI_PROJECT_DIR/scripts/android/build-test-emulator.sh
236264
# Currently job below just build HERE Data SDK for Android and start AVD by Android SDK emulator.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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 will build olp-cpp-sdk-performance-tests for further execution with CPU/RAM metrics
21+
22+
mkdir -p build && cd build
23+
24+
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOLP_SDK_NO_EXCEPTION=ON -DBUILD_SHARED_LIBS=ON -DOLP_SDK_ENABLE_TESTING=ON ..
25+
26+
cmake --build . --target olp-cpp-sdk-performance-tests
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
[
2+
{
3+
"name": "MemoryUsage/MemoryTest.ReadNPartitionsFromVersionedLayer/15m_test",
4+
"repeat": 1,
5+
"metric_infos": [
6+
{
7+
"name": "Performance",
8+
"metrics": [
9+
"max_mem",
10+
"avg_mem",
11+
"max_cpu",
12+
"avg_cpu"
13+
]
14+
}
15+
],
16+
"charts" : [
17+
{
18+
"name": "ReadNPartitionsFromVersionedLayer/15m_test",
19+
"source": "Performance",
20+
"charts": [
21+
{
22+
"name": "CPU usage",
23+
"units": "Percentage ( CPU model: sed_cpu_model sed_mhz. Core: sed_n_core. )",
24+
"values": [
25+
{"Maximum": "max_cpu"},
26+
{"Average": "avg_cpu"}
27+
]
28+
},
29+
{
30+
"name": "RAM usage",
31+
"units": "MB ( Total: sed_memory_total )",
32+
"values": [
33+
{"Maximum": "max_mem"},
34+
{"Average": "avg_mem"}
35+
]
36+
}
37+
]
38+
}
39+
]
40+
}
41+
]

0 commit comments

Comments
 (0)