Skip to content

Commit

Permalink
Merge pull request #143 from harness/revert-137-PL-57665-new
Browse files Browse the repository at this point in the history
Revert "check for no jfr variables"
  • Loading branch information
siraj-io authored Nov 18, 2024
2 parents e9f7773 + e20e557 commit 683397e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 29 deletions.
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.70
version: 1.3.71

# 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
30 changes: 2 additions & 28 deletions src/common/templates/_jfr-helper.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ USAGE:
*/}}
{{- define "harnesscommon.jfr.v1.renderEnvironmentVars" }}
{{- $ := .ctx }}
{{- $waitTime := "20" }}
{{- if hasKey $.Values "jfr" }}
{{- if hasKey $.Values.jfr "sleep" }}
{{- $waitTime = $.Values.jfr.sleep }}
{{- end }}
{{- end }}
{{- if $.Values.global.jfr.enabled }}
- name: POD_NAME
valueFrom:
Expand All @@ -21,8 +15,6 @@ USAGE:
value: {{ default "default" $.Values.envType }}
- name: JFR_DUMP_ROOT_LOCATION
value: {{ default "/opt/harness" $.Values.jfrDumpRootLocation }}
- name: WAIT_TIME
value: {{ $waitTime }}
{{- end }}
{{- end }}

Expand Down Expand Up @@ -50,7 +42,7 @@ preStop:
- -c
- |
touch shutdown;
sleep ${WAIT_TIME};
sleep 20;
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 @@ -115,25 +107,7 @@ USAGE:
{{- $ := .ctx }}
{{- $javaAdvancedFlags := default "" $.Values.javaAdvancedFlags }}
{{- $jfrDumpRootLocation := default "/opt/harness" $.Values.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 "-Xms64M -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}}
{{- $jfrFlags := printf "-Xms64M -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}}
{{- if $.Values.global.jfr.enabled }}
{{- $javaAdvancedFlags = printf "%s %s" $javaAdvancedFlags $jfrFlags }}
{{- end }}
Expand Down

0 comments on commit 683397e

Please sign in to comment.