From 8726ec6266c868d7d4bd3f9ef1aff1f031b8b2c0 Mon Sep 17 00:00:00 2001 From: Sebas Date: Fri, 25 Oct 2019 13:37:08 +0200 Subject: [PATCH 1/2] Script made for benchmarking --- scriptBench.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 scriptBench.sh diff --git a/scriptBench.sh b/scriptBench.sh new file mode 100644 index 0000000..3c0c28b --- /dev/null +++ b/scriptBench.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +echo "Benchmark report" >> benchmark_report +echo "--------------------" >> benchmark_report +i="0" +total=0 +while [ $i -lt 5 ] +do + start=`date +%s` + mvn test --quiet + end=`date +%s` + runtime=$((end-start)) + total=$((total+runtime)) + i=$(($i + 1)) + echo " - Time spent job $i: $runtime" >> benchmark_report +done + +mean=$((total/5)) +echo "--------------------" >> benchmark_report +echo "Total time spent ($i jobs): $total" >> benchmark_report +echo "Time spent per job: $mean" >> benchmark_report +echo "--------------------" >> benchmark_report \ No newline at end of file From 0d3ae5d511d041048ff56cd616487573adfb82ad Mon Sep 17 00:00:00 2001 From: Sebas Date: Fri, 25 Oct 2019 13:47:20 +0200 Subject: [PATCH 2/2] Benchmark added to CI --- .circleci/config.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 82c221e..06d7245 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -167,6 +167,21 @@ jobs: - maven_command_with_cache: command: mvn deploy + benchmark: + executor: main_exe + steps: + - maven_command_with_cache: + command: mvn package + - run: + name: Run benchmarks + command: sh scriptTime.sh + - run: + command: | + mkdir -p benchmark + mv benchmark_report benchmark/ + - store_artifacts: + path: benchmark + destination: benchmark workflows: main_flow: jobs: @@ -189,4 +204,14 @@ workflows: only: - master requires: - - package \ No newline at end of file + - package + master-scheduled-benchmark: + triggers: + - schedule: + cron: "0 12 * * *" + filters: + branches: + only: + - master + jobs: + - benchmark \ No newline at end of file