Add parameters to enable profile agent to startup script

This commit is contained in:
Simon Detheridge 2021-06-23 14:58:25 +01:00
parent c46f460527
commit a469bc6732

View file

@ -1,8 +1,13 @@
#!/bin/bash
/opt/envsubst < /envsubst_template.json > /conf/runtime.json
if [ "x$GIT_BRIDGE_JVM_ARGS" == "x" ]; then
GIT_BRIDGE_JVM_ARGS="-XX:+UseContainerSupport -XX:MaxRAMPercentage=50.0"
fi
if [ "$ENABLE_PROFILE_AGENT" == "true" ]; then
GIT_BRIDGE_JVM_ARGS="-agentpath:/opt/cprof/profiler_java_agent.so=-cprof_service=git-bridge,-cprof_service_version=1.0.0,-cprof_enable_heap_sampling=true ${GIT_BRIDGE_JVM_ARGS}"
fi
exec java $GIT_BRIDGE_JVM_ARGS -jar /git-bridge.jar /conf/runtime.json