Skip to content

Commit 06c2005

Browse files
author
qarlosalberto
committed
ci: build time
1 parent ba0e5b2 commit 06c2005

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

.gitlab-ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,12 @@ unit coverage:
225225
variables:
226226
coverage_report: summary
227227
when: always # Even if previous stages/required jobs fail
228+
allow_failure: true
228229
- if: $CI_DESCRIPTION =~ /Nightly/
229230
variables:
230231
coverage_report: full
231232
when: always # Even if previous stages/required jobs fail
233+
allow_failure: true
232234
before_script:
233235
- PACKAGE_URL=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/coverage/${CI_COMMIT_BRANCH}${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}/coverage_history.tar.gz
234236
# Download coverage history from the registry
@@ -268,6 +270,11 @@ unit coverage:
268270
if [[ $coverage_report = "full" ]]; then
269271
publish_to_registry
270272
fi
273+
- export PIP_EXTRA_INDEX_URL=""
274+
- apk update; apk add python3 py3-pip
275+
- pip3 install --verbose retina-reporter --index-url https://__token__:[email protected]/api/v4/projects/44296988/packages/pypi/simple
276+
- retina-reporter --input build_time_metrics.json --bucket ci --db-config token=$INFLUXDB_TOKEN org=$INFLUXDB_ORG url=$INFLUXDB_URL
277+
271278
coverage: /^\s*Line coverage:\s*\d+.\d+\%/
272279
artifacts:
273280
paths:

.gitlab/ci/build.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ variables:
110110
- !reference [.fetch_src_cache, before_script]
111111
- |
112112
build_srsgnb() {
113+
start_time=$(date +%s)
114+
113115
if [ -n "${UHD_VERSION}" ]; then
114116
BUILD_ARGS="${BUILD_ARGS} -u ${UHD_VERSION}"
115117
fi
@@ -174,6 +176,13 @@ variables:
174176
/usr/local/builder_tools/bin/python /usr/local/bin/changed_tests.py -b . -o "../$OUTPUT_FINGERPRINT"
175177
cd ..
176178
fi
179+
180+
end_time=$(date +%s)
181+
execution_time=$((end_time - start_time))
182+
echo "Build time is: $execution_time seconds"
183+
export metric_prefix=""
184+
if [[ $ON_MR == "true" ]]; then metric_prefix="_cached"; fi
185+
echo '[{"name":"build","description":"Compilation","tests":[{"name":"'$OS'","description":"'$OS' build","metrics":[{"name":"build_time'$metric_prefix'","description":"Build time","value":['$execution_time'],"unit":"seconds","type":"time"}],"duts":[]}]}]' >> build_time_metrics.json
177186
}
178187
- |
179188
launch_tests() {
@@ -257,6 +266,7 @@ variables:
257266
- ${CI_JOB_ID}_coverage.xml
258267
- build/apps/gnb/gnb
259268
- build/Testing/Temporary/MemoryChecker.*.log
269+
- build_time_metrics.json
260270
expire_in: 10 minutes
261271
cache:
262272
- !reference [.fetch_src_cache, cache]

0 commit comments

Comments
 (0)