You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -169,16 +169,16 @@ USAGE:
169
169
Run a JCMD command on a running Java application via --args, downloads and deletes all files that are created in the current folder, use '--no-download' to prevent this
170
170
171
171
jfr-start
172
-
Start a Java Flight Recorder default recording on a running Java application
172
+
Start a Java Flight Recorder default recording on a running Java application (stores in the the container-dir)
173
173
174
174
jfr-start-profile
175
-
Start a Java Flight Recorder profile recording on a running Java application
175
+
Start a Java Flight Recorder profile recording on a running Java application (stores in the the container-dir))
176
176
177
177
jfr-start-gc (recent SapMachine only)
178
-
Start a Java Flight Recorder GC recording on a running Java application
178
+
Start a Java Flight Recorder GC recording on a running Java application (stores in the the container-dir)
179
179
180
180
jfr-start-gc-details (recent SapMachine only)
181
-
Start a Java Flight Recorder detailed GC recording on a running Java application
181
+
Start a Java Flight Recorder detailed GC recording on a running Java application (stores in the the container-dir)
182
182
183
183
jfr-stop
184
184
Stop a Java Flight Recorder recording on a running Java application
@@ -196,7 +196,7 @@ USAGE:
196
196
Print vital statistics about the Java Virtual Machine running a Java application
197
197
198
198
asprof (recent SapMachine only, supports --args)
199
-
Run async-profiler commands passed to asprof via --args, copies files in the current folder. Don't use in combination with asprof-* commands. Downloads and deletes all files that are created in the current folder, use '--no-download' to prevent this
199
+
Run async-profiler commands passed to asprof via --args, copies files in the current folder. Don't use in combination with asprof-* commands. Downloads and deletes all files that are created in the current folder, if not using 'start' asprof command, use '--no-download' to prevent this.
200
200
201
201
asprof-start-cpu (recent SapMachine only)
202
202
Start an async-profiler CPU-time profile recording on a running Java application
@@ -217,13 +217,13 @@ USAGE:
217
217
Get the status of async-profiler on a running Java application
218
218
219
219
OPTIONS:
220
-
-dry-run -n, just output to command line what would be executed
221
-
-keep -k, keep the heap dump in the container; by default the heap dump/JFR/... will be deleted from the container's filesystem after been downloaded
222
220
-local-dir -ld, the local directory path that the dump/JFR/... file will be saved to, defaults to the current directory
223
221
-no-download -nd, don't download the heap dump/JFR/... file to local, only keep it in the container, implies '--keep'
224
222
-app-instance-index -i [index], select to which instance of the app to connect
225
223
-args -a, Miscellaneous arguments to pass to the command (if supported) in the container, be aware to end it with a space if it is a simple option
226
224
-container-dir -cd, the directory path in the container that the heap dump/JFR/... file will be saved to
225
+
-dry-run -n, just output to command line what would be executed
226
+
-keep -k, keep the heap dump in the container; by default the heap dump/JFR/... will be deleted from the container's filesystem after been downloaded
227
227
</pre>
228
228
229
229
The heap dumps and profiles will be copied to a local file if `-local-dir` is specified as a full folder path. Without providing `-local-dir` the heap dump will only be created in the container and not transferred.
Copy file name to clipboardExpand all lines: cf_cli_java_plugin.go
+58-21
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,15 @@ func (u uuidGeneratorImpl) Generate() string {
57
57
58
58
const (
59
59
// JavaDetectionCommand is the prologue command to detect on the Garden container if it contains a Java app. Visible for tests
60
-
JavaDetectionCommand="if ! pgrep -x \"java\" > /dev/null; then echo \"No 'java' process found running. Are you sure this is a Java app?\" >&2; exit 1; fi"
60
+
JavaDetectionCommand="if ! pgrep -x \"java\" > /dev/null; then echo \"No 'java' process found running. Are you sure this is a Java app?\" >&2; exit 1; fi"
61
+
CheckNoCurrentJFRRecordingCommand=`OUTPUT=$($JCMD_COMMAND $(pidof java) JFR.check 2>&1); if [[ ! "$OUTPUT" == *"No available recording"* ]]; then echo "JFR recording already running. Stop it before starting a new recording."; exit 1; fi;`
Description: "Start a Java Flight Recorder default recording on a running Java application",
204
+
Description: "Start a Java Flight Recorder default recording on a running Java application (stores in the the container-dir)",
192
205
RequiredTools: []string{"jcmd"},
193
206
GenerateFiles: false,
194
-
SshCommand: `$JCMD_COMMAND $(pidof java) JFR.start settings=profile.jfc; echo "Use 'cf java jfr-stop $$APP_NAME' to copy the file to the local folder"`,
echo "Use 'cf java jfr-stop $$APP_NAME' to copy the file to the local folder"`,
195
214
},
196
215
{
197
216
Name: "jfr-start-profile",
198
-
Description: "Start a Java Flight Recorder profile recording on a running Java application",
217
+
Description: "Start a Java Flight Recorder profile recording on a running Java application (stores in the the container-dir))",
199
218
RequiredTools: []string{"jcmd"},
200
219
GenerateFiles: false,
201
-
SshCommand: `$JCMD_COMMAND $(pidof java) JFR.start settings=profile.jfc; echo "Use 'cf java jfr-stop $$APP_NAME' to copy the file to the local folder"`,
echo "Use 'cf java jfr-stop $$APP_NAME' to copy the file to the local folder"`,
210
241
},
211
242
{
212
243
Name: "jfr-start-gc-details",
213
-
Description: "Start a Java Flight Recorder detailed GC recording on a running Java application",
244
+
Description: "Start a Java Flight Recorder detailed GC recording on a running Java application (stores in the the container-dir)",
214
245
RequiredTools: []string{"jcmd"},
215
246
GenerateFiles: false,
216
247
OnlyOnRecentSapMachine: true,
217
-
SshCommand: `$JCMD_COMMAND $(pidof java) JFR.start settings=gc_details.jfc; echo "Use 'cf java jfr-stop $$APP_NAME' to copy the file to the local folder"`,
"app-instance-index": "-i [index], select to which instance of the app to connect",
638
-
"no-download": "-nd, don't download the heap dump/JFR/... file to local, only keep it in the container, implies '--keep'",
675
+
"no-download": "-nd, don't download the heap dump/JFR/... file to local, only keep it in the container, implies '--keep'",
639
676
"keep": "-k, keep the heap dump in the container; by default the heap dump/JFR/... will be deleted from the container's filesystem after been downloaded",
640
677
"dry-run": "-n, just output to command line what would be executed",
641
678
"container-dir": "-cd, the directory path in the container that the heap dump/JFR/... file will be saved to",
0 commit comments