-
Notifications
You must be signed in to change notification settings - Fork 312
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
start_server() { | ||
local VARIANT=$1 | ||
local JAVA_OPTS=$2 | ||
|
||
if [ -n "$CI_JOB_TOKEN" ]; then | ||
# Inside BP, so we can assume 24 CPU cores available and set CPU affinity | ||
CPU_AFFINITY_APP=$3 | ||
else | ||
CPU_AFFINITY_APP="" | ||
fi | ||
|
||
mkdir -p "${LOGS_DIR}/${VARIANT}" | ||
${CPU_AFFINITY_APP}java ${JAVA_OPTS} -Xms3G -Xmx3G -jar ${INSECURE_BANK} &> ${LOGS_DIR}/${VARIANT}/insecure-bank.log &PID=$! | ||
echo "${CPU_AFFINITY_APP}java ${JAVA_OPTS} -Xms3G -Xmx3G -jar ${INSECURE_BANK} &> ${LOGS_DIR}/${VARIANT}/insecure-bank.log [PID=$PID]" | ||
} | ||
|
||
start_server "no_agent" "-Dserver.port=8080" "taskset -c 47 " & | ||
start_server "tracing" "-javaagent:${TRACER} -Dserver.port=8081" "taskset -c 46 " & | ||
start_server "profiling" "-javaagent:${TRACER} -Ddd.profiling.enabled=true -Dserver.port=8082" "taskset -c 45 " & | ||
start_server "iast" "-javaagent:${TRACER} -Ddd.iast.enabled=true -Dserver.port=8083" "taskset -c 44 " & | ||
start_server "iast_GLOBAL" "-javaagent:${TRACER} -Ddd.iast.enabled=true -Ddd.iast.context.mode=GLOBAL -Dserver.port=8084" "taskset -c 43 " & | ||
start_server "iast_FULL" "-javaagent:${TRACER} -Ddd.iast.enabled=true -Ddd.iast.detection.mode=FULL -Dserver.port=8085" "taskset -c 42 " & | ||
|
||
wait |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,61 @@ | ||
import http from 'k6/http'; | ||
import {checkResponse, isOk} from "../../utils/k6.js"; | ||
|
||
const baseUrl = 'http://localhost:8080'; | ||
const variants = { | ||
"no_agent": { | ||
"APP_URL": 'http://localhost:8080', | ||
}, | ||
"tracing": { | ||
"APP_URL": 'http://localhost:8081', | ||
}, | ||
"profiling": { | ||
"APP_URL": 'http://localhost:8082', | ||
}, | ||
"appsec": { | ||
"APP_URL": 'http://localhost:8083', | ||
}, | ||
"iast": { | ||
"APP_URL": 'http://localhost:8084', | ||
}, | ||
"code_origins": { | ||
"APP_URL": 'http://localhost:8085', | ||
} | ||
} | ||
|
||
export const options = function (variants) { | ||
const scenarios = {}; | ||
for (const variant of Object.keys(variants)) { | ||
scenarios[`load--petclinic--${variant}--warmup`] = { | ||
executor: 'constant-vus', // https://grafana.com/docs/k6/latest/using-k6/scenarios/executors/#all-executors | ||
vus: 5, | ||
duration: '20s', | ||
gracefulStop: '2s', | ||
env: { | ||
"APP_URL": variants[variant]["APP_URL"] | ||
} | ||
}; | ||
|
||
scenarios[`load--petclinic--${variant}--high_load`] = { | ||
executor: 'constant-vus', | ||
vus: 5, | ||
startTime: '22s', | ||
duration: '15s', | ||
gracefulStop: '2s', | ||
env: { | ||
"APP_URL": variants[variant]["APP_URL"] | ||
} | ||
}; | ||
} | ||
|
||
export const options = { | ||
discardResponseBodies: true, | ||
vus: 5, | ||
iterations: 80000 | ||
}; | ||
return { | ||
discardResponseBodies: true, | ||
scenarios, | ||
} | ||
}(variants); | ||
|
||
export default function () { | ||
|
||
// find owner | ||
const ownersList = http.get(`${baseUrl}/owners?lastName=`); | ||
const ownersList = http.get(`${__ENV.APP_URL}/owners?lastName=`); | ||
checkResponse(ownersList, isOk); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
start_server() { | ||
local VARIANT=$1 | ||
local JAVA_OPTS=$2 | ||
|
||
if [ -n "$CI_JOB_TOKEN" ]; then | ||
# Inside BP, so we can assume 24 CPU cores available and set CPU affinity | ||
CPU_AFFINITY_APP=$3 | ||
else | ||
CPU_AFFINITY_APP="" | ||
fi | ||
|
||
mkdir -p "${LOGS_DIR}/${VARIANT}" | ||
${CPU_AFFINITY_APP}java ${JAVA_OPTS} -Xms2G -Xmx2G -jar ${PETCLINIC} &> ${LOGS_DIR}/${VARIANT}/petclinic.log &PID=$! | ||
echo "${CPU_AFFINITY_APP}java ${JAVA_OPTS} -Xms2G -Xmx2G -jar ${PETCLINIC} &> ${LOGS_DIR}/${VARIANT}/petclinic.log [PID=$!]" | ||
} | ||
|
||
start_server "no_agent" "-Dserver.port=8080" "taskset -c 31-32 " & | ||
start_server "tracing" "-javaagent:${TRACER} -Dserver.port=8081" "taskset -c 33-34 " & | ||
start_server "profiling" "-javaagent:${TRACER} -Ddd.profiling.enabled=true -Dserver.port=8082" "taskset -c 35-36 " & | ||
start_server "appsec" "-javaagent:${TRACER} -Ddd.appsec.enabled=true -Dserver.port=8083" "taskset -c 37-38 " & | ||
start_server "iast" "-javaagent:${TRACER} -Ddd.iast.enabled=true -Dserver.port=8084" "taskset -c 39-40 " & | ||
start_server "code_origins" "-javaagent:${TRACER} -Ddd.code.origin.for.spans.enabled=true -Dserver.port=8085" "taskset -c 41-42 " & | ||
|
||
wait |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,77 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
|
||
set -e | ||
|
||
function message() { | ||
echo "$(date +"%T"): $1" | ||
} | ||
|
||
function healthcheck() { | ||
local url=$1 | ||
|
||
while true; do | ||
if [[ $(curl -fso /dev/null -w "%{http_code}" "${url}") = 200 ]]; then | ||
break | ||
fi | ||
done | ||
} | ||
|
||
type=$1 | ||
|
||
if [ -n "$CI_JOB_TOKEN" ]; then | ||
# Inside BP, so we can assume 24 CPU cores on the second socket available and set CPU affinity | ||
export CPU_AFFINITY_K6="taskset -c 24-27 " | ||
else | ||
export CPU_AFFINITY_K6="" | ||
fi | ||
|
||
source "${UTILS_DIR}/update-java-version.sh" 17 | ||
"${UTILS_DIR}/run-sirun-benchmarks.sh" "$@" | ||
|
||
for app in *; do | ||
if [[ ! -d "${app}" ]]; then | ||
continue | ||
fi | ||
|
||
message "${type} benchmark: ${app} started" | ||
|
||
export OUTPUT_DIR="${REPORTS_DIR}/${type}/${app}" | ||
mkdir -p ${OUTPUT_DIR} | ||
|
||
export LOGS_DIR="${ARTIFACTS_DIR}/${type}/${app}" | ||
mkdir -p ${LOGS_DIR} | ||
|
||
# Using profiler variants for healthcheck as they are the slowest | ||
if [ "${app}" == "petclinic" ]; then | ||
HEALTHCHECK_URL=http://localhost:8082 | ||
REPETITIONS_COUNT=5 | ||
elif [ "${app}" == "insecure-bank" ]; then | ||
HEALTHCHECK_URL=http://localhost:8082/login | ||
REPETITIONS_COUNT=2 | ||
else | ||
echo "Unknown app ${app}" | ||
exit 1 | ||
fi | ||
|
||
for i in $(seq 1 $REPETITIONS_COUNT); do | ||
bash -c "${UTILS_ 7036 DIR}/../${type}/${app}/start-servers.sh" & | ||
|
||
echo "Waiting for serves to start..." | ||
if [ "${app}" == "petclinic" ]; then | ||
for port in $(seq 8080 8085); do | ||
healthcheck http://localhost:$port | ||
done | ||
elif [ "${app}" == "insecure-bank" ]; then | ||
for port in $(seq 8080 8085); do | ||
healthcheck http://localhost:$port/login | ||
done | ||
fi | ||
echo "Servers are up!" | ||
|
||
( | ||
cd ${app} && | ||
bash -c "${CPU_AFFINITY_K6}${UTILS_DIR}/run-k6-load-test.sh 'pkill java'" | ||
) | ||
done | ||
|
||
message "${type} benchmark: ${app} finished" | ||
done |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix benchmark failures and improve results quality #8962
New issue
Sign up for GitHub
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Fix benchmark failures and improve results quality #8962
Changes from all commits
db10cbc
7245a76
20f1d6a
6ce4ca6
06cf0bb
5edc665
85a9dee
2d59094
76060dc
02de582
391519f
8ba2eee
3e9ec83
987daf6
4ec4ad7
6b085c9
4654c1a
c71da3e
b137845
4ea19a0
28de22a
4cbcacc
238ea6a
e82f1e4
660cf7c
a0cb015
4d2fbd6
077c92d
c61647a
82bd4f5
cfa13c0
86fc41f
4c0c13a
7fa0083
3dd9879
b5268bb
cd930aa
9469599
b17c403
50dbe86
365255e
7cbbd51
b799d72
0746b0c
df980c3
8aa0cca
ab054eb
b23b4dc
b137583
72502fb
1df8515
db5d3e1
e4eced2
8e78e94
c40ca32
e3de508
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.