-
Notifications
You must be signed in to change notification settings - Fork 334
Expand file tree
/
Copy pathbenchmarks.sh
More file actions
executable file
·42 lines (38 loc) · 1.2 KB
/
benchmarks.sh
File metadata and controls
executable file
·42 lines (38 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
set -eu
readonly SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
export TRACER_DIR="${SCRIPT_DIR}/.."
export REPORTS_DIR="${SCRIPT_DIR}/reports"
export UTILS_DIR="${SCRIPT_DIR}/utils"
export SHELL_UTILS_DIR="${UTILS_DIR}/shell"
export K6_UTILS_DIR="${UTILS_DIR}/k6"
export TRACER="${SCRIPT_DIR}/tracer/dd-java-agent.jar"
export NO_AGENT_VARIANT="no_agent"
run_benchmarks() {
local type=$1
if [[ -d "${type}" ]] && [[ -f "${type}/run.sh" ]]; then
cd "${type}"
./run.sh "$@"
cd "${SCRIPT_DIR}"
fi
}
# Find or rebuild tracer to be used in the benchmarks
if [[ ! -f "${TRACER}" ]]; then
mkdir -p "${SCRIPT_DIR}/tracer"
cd "${TRACER_DIR}"
readonly TRACER_VERSION=$(./gradlew properties -q | grep "version:" | awk '{print $2}')
readonly TRACER_COMPILED="${SCRIPT_DIR}/../dd-java-agent/build/libs/dd-java-agent-${TRACER_VERSION}.jar"
if [[ ! -f "${TRACER_COMPILED}" ]]; then
echo "Tracer not found, starting gradle compile ..."
./gradlew assemble
fi
cp "${TRACER_COMPILED}" "${TRACER}"
cd "${SCRIPT_DIR}"
fi
if [[ "$#" == '0' ]]; then
for type in 'startup' 'load' 'dacapo'; do
run_benchmarks "$type"
done
else
run_benchmarks "$@"
fi