Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: library
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.3.82
version: 1.3.83

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
24 changes: 22 additions & 2 deletions src/common/templates/_jfr-helper.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ USAGE:
value: {{ default "default" $.Values.envType }}
- name: JFR_DUMP_ROOT_LOCATION
value: {{ default "/opt/harness" $.Values.jfrDumpRootLocation }}
- name: WAIT_TIME
value: {{ default "20" $.Values.jfr.sleep | quote }}
{{- end }}
{{- end }}

Expand Down Expand Up @@ -43,7 +45,7 @@ preStop:
- -c
- |
touch shutdown;
sleep 20;
sleep ${WAIT_TIME};
ts=$(date '+%s');
loc=${JFR_DUMP_ROOT_LOCATION}/dumps/${SERVICE_NAME}/${ENV_TYPE}/$ts/${POD_NAME};
mkdir -p $loc; sleep 1; echo $ts > $loc/restart;
Expand Down Expand Up @@ -108,7 +110,25 @@ USAGE:
{{- $ := .ctx }}
{{- $javaAdvancedFlags := default "" $.Values.javaAdvancedFlags }}
{{- $jfrDumpRootLocation := default "/opt/harness" $.Values.jfrDumpRootLocation }}
{{- $jfrFlags := printf "-XX:StartFlightRecording=disk=true,name=jfrRecording,maxage=12h,dumponexit=true,filename=%s/POD_NAME/jfr_dumponexit.jfr,settings=/opt/harness/profile.jfc -XX:FlightRecorderOptions=maxchunksize=20M,memorysize=20M,repository=%s/POD_NAME --add-reads jdk.jfr=ALL-UNNAMED -Dotel.instrumentation.redisson.enabled=false" $jfrDumpRootLocation $jfrDumpRootLocation}}
{{- $maxage := "12h" }}
{{- $jfcFilePath := "/opt/harness/profile.jfc" }}
{{- $maxchunksize := "20M" }}
{{- $memorysize := "20M" }}
{{- if hasKey $.Values "jfr" }}
{{- if hasKey $.Values.jfr "maxage" }}
{{- $maxage = $.Values.jfr.maxage }}
{{- end }}
{{- if hasKey $.Values.jfr "jfcFilePath" }}
{{- $jfcFilePath = $.Values.jfr.jfcFilePath }}
{{- end }}
{{- if hasKey $.Values.jfr "maxchunksize" }}
{{- $maxchunksize = $.Values.jfr.maxchunksize }}
{{- end }}
{{- if hasKey $.Values.jfr "memorysize" }}
{{- $memorysize = $.Values.jfr.memorysize }}
{{- end }}
{{- end }}
{{- $jfrFlags := printf "-XX:StartFlightRecording=disk=true,name=jfrRecording,maxage=%s,dumponexit=true,filename=%s/POD_NAME/jfr_dumponexit.jfr,settings=%s -XX:FlightRecorderOptions=maxchunksize=%s,memorysize=%s,repository=%s/POD_NAME --add-reads jdk.jfr=ALL-UNNAMED -Dotel.instrumentation.redisson.enabled=false" $maxage $jfrDumpRootLocation $jfcFilePath $maxchunksize $memorysize $jfrDumpRootLocation}}
{{- if $.Values.global.jfr.enabled }}
{{- $javaAdvancedFlags = printf "%s %s" $javaAdvancedFlags $jfrFlags }}
{{- end }}
Expand Down