Skip to content

Commit 8f04672

Browse files
committed
allow to specify delay,duration,maxAge and maxSize as string
1 parent ef45678 commit 8f04672

File tree

10 files changed

+50
-59
lines changed

10 files changed

+50
-59
lines changed

visualvm/application/src/org/graalvm/visualvm/application/jvm/DefaultJvm.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ public String takeJfrDump(long recording, String fileName) {
218218
throw new UnsupportedOperationException();
219219
}
220220

221-
public boolean startJfrRecording(String name, String[] settings, Long delay,
222-
Long duration, Boolean disk, String path, Long maxAge, Long maxSize,
221+
public boolean startJfrRecording(String name, String[] settings, String delay,
222+
String duration, Boolean disk, String path, String maxAge, String maxSize,
223223
Boolean dumpOnExit) {
224224
throw new UnsupportedOperationException();
225225
}

visualvm/application/src/org/graalvm/visualvm/application/jvm/Jvm.java

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -392,26 +392,25 @@ public int getAvailableProcessors() {
392392
* @param name optional name that can be used to identify recording.
393393
* @param settings names of settings files to use, i.e. "default" or
394394
* "default.jfc".
395-
* @param delay delay before recording is started, in nanoseconds. Must be
396-
* at least 1 second.
397-
* @param duration duration of the recording, in nanoseconds. Must be at
398-
* least 1 second.
395+
* @param delay optional delay recording start with (s)econds, (m)inutes),
396+
* (h)ours), or (d)ays, e.g. 5h.
397+
* @param duration optional duration of recording in (s)econds, (m)inutes,
398+
* (h)ours, or (d)ays, e.g. 300s.
399399
* @param disk if recording should be persisted to disk
400400
* @param path file path where recording data should be written
401-
* @param maxAge how long recording data should be kept in the disk
402-
* repository, or <code>0</code> if no limit should be set.
403-
*
404-
* @param maxSize the minimum amount data to keep in the disk repository
405-
* before it is discarded, or <code>0</code> if no limit should be
406-
* set.
407-
*
401+
* @param maxAge optional maximum time to keep recorded data (on disk) in
402+
* (s)econds, (m)inutes, (h)ours, or (d)ays, e.g. 60m,
403+
* or <code>0</code> if no limit should be set.
404+
* @param maxSize optional maximum amount of bytes to keep (on disk) in
405+
* (k)B, (M)B or (G)B, e.g. 500M, or <code>0</code> if no
406+
* limit should be set.
408407
* @param dumpOnExit if recording should dump on exit
409408
*
410409
* @return true if recording was successfully started.
411410
*/
412-
public abstract boolean startJfrRecording(String name, String[] settings, Long delay,
413-
Long duration, Boolean disk, String path, Long maxAge, Long maxSize,
414-
Boolean dumpOnExit);
411+
public abstract boolean startJfrRecording(String name, String[] settings,
412+
String delay, String duration, Boolean disk, String path,
413+
String maxAge, String maxSize, Boolean dumpOnExit);
415414

416415
/**
417416
* Stops JFR recording.

visualvm/attach/src/org/graalvm/visualvm/attach/AttachModelImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ public String takeJfrDump(long recording, String fileName) {
249249
return executeJCmd(JCMD_JFR_DUMP, pars);
250250
}
251251

252-
public boolean startJfrRecording(String name, String[] settings, Long delay,
253-
Long duration, Boolean disk, String path, Long maxAge, Long maxSize,
252+
public boolean startJfrRecording(String name, String[] settings, String delay,
253+
String duration, Boolean disk, String path, String maxAge, String maxSize,
254254
Boolean dumpOnExit) {
255255
if (!isJfrAvailable()) {
256256
throw new UnsupportedOperationException();

visualvm/graalvm/src/org/graalvm/visualvm/graalvm/svm/SVMJVMImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,8 @@ public String takeJfrDump(long recording, String fileName) {
376376
throw new UnsupportedOperationException();
377377
}
378378

379-
public boolean startJfrRecording(String name, String[] settings, Long delay,
380-
Long duration, Boolean disk, String path, Long maxAge, Long maxSize,
379+
public boolean startJfrRecording(String name, String[] settings, String delay,
380+
String duration, Boolean disk, String path, String maxAge, String maxSize,
381381
Boolean dumpOnExit) {
382382
throw new UnsupportedOperationException();
383383
}

visualvm/jmx/src/org/graalvm/visualvm/jmx/impl/DisconnectedJmxModel.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,7 @@ public String takeJfrDump(long recording, String fileName) {
124124
}
125125

126126
@Override
127-
public boolean startJfrRecording(String name, String[] settings, Long delay,
128-
Long duration, Boolean disk, String path, Long maxAge, Long maxSize,
129-
Boolean dumpOnExit) {
127+
public boolean startJfrRecording(String name, String[] settings, String delay, String duration, Boolean disk, String path, String maxAge, String maxSize, Boolean dumpOnExit) {
130128
return false;
131129
}
132130

visualvm/jmx/src/org/graalvm/visualvm/jmx/impl/JmxModelImpl.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,7 @@ public String takeJfrDump(long recording, String fileName) {
333333
return support.takeJfrDump(recording, fileName);
334334
}
335335

336-
public boolean startJfrRecording(String name, String[] settings, Long delay,
337-
Long duration, Boolean disk, String path, Long maxAge, Long maxSize,
338-
Boolean dumpOnExit) {
336+
public boolean startJfrRecording(String name, String[] settings, String delay, String duration, Boolean disk, String path, String maxAge, String maxSize, Boolean dumpOnExit) {
339337
JmxSupport support = getJmxSupport();
340338
if (support.isReadOnlyConnection()) {
341339
return false;

visualvm/jmx/src/org/graalvm/visualvm/jmx/impl/JmxSupport.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -511,9 +511,7 @@ String takeJfrDump(long recording, String fileName) {
511511
return executeJCmd(JCMD_JFR_DUMP, pars);
512512
}
513513

514-
boolean startJfrRecording(String name, String[] settings, Long delay,
515-
Long duration, Boolean disk, String path, Long maxAge, Long maxSize,
516-
Boolean dumpOnExit) {
514+
boolean startJfrRecording(String name, String[] settings, String delay, String duration, Boolean disk, String path, String maxAge, String maxSize, Boolean dumpOnExit) {
517515
if (!isJfrAvailable()) {
518516
throw new UnsupportedOperationException();
519517
}

visualvm/jvm/src/org/graalvm/visualvm/jvm/JVMImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,8 +545,8 @@ public String takeJfrDump(long recording, String fileName) {
545545
return null;
546546
}
547547

548-
public boolean startJfrRecording(String name, String[] settings, Long delay,
549-
Long duration, Boolean disk, String path, Long maxAge, Long maxSize,
548+
public boolean startJfrRecording(String name, String[] settings, String delay,
549+
String duration, Boolean disk, String path, String maxAge, String maxSize,
550550
Boolean dumpOnExit) {
551551
AttachModel attach = getAttach();
552552

visualvm/tools/src/org/graalvm/visualvm/tools/attach/AttachModel.java

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -150,26 +150,25 @@ public abstract class AttachModel extends Model {
150150
* @param name optional name that can be used to identify recording.
151151
* @param settings names of settings files to use, i.e. "default" or
152152
* "default.jfc".
153-
* @param delay delay before recording is started, in nanoseconds. Must be
154-
* at least 1 second.
155-
* @param duration duration of the recording, in nanoseconds. Must be at
156-
* least 1 second.
153+
* @param delay optional delay recording start with (s)econds, (m)inutes),
154+
* (h)ours), or (d)ays, e.g. 5h.
155+
* @param duration optional duration of recording in (s)econds, (m)inutes,
156+
* (h)ours, or (d)ays, e.g. 300s.
157157
* @param disk if recording should be persisted to disk
158158
* @param path file path where recording data should be written
159-
* @param maxAge how long recording data should be kept in the disk
160-
* repository, or <code>0</code> if no limit should be set.
161-
*
162-
* @param maxSize the minimum amount data to keep in the disk repository
163-
* before it is discarded, or <code>0</code> if no limit should be
164-
* set.
165-
*
159+
* @param maxAge optional maximum time to keep recorded data (on disk) in
160+
* (s)econds, (m)inutes, (h)ours, or (d)ays, e.g. 60m,
161+
* or <code>0</code> if no limit should be set.
162+
* @param maxSize optional maximum amount of bytes to keep (on disk) in
163+
* (k)B, (M)B or (G)B, e.g. 500M, or <code>0</code> if no
164+
* limit should be set.
166165
* @param dumpOnExit if recording should dump on exit
167166
*
168167
* @return true if recording was successfully started.
169168
*/
170-
public abstract boolean startJfrRecording(String name, String[] settings, Long delay,
171-
Long duration, Boolean disk, String path, Long maxAge, Long maxSize,
172-
Boolean dumpOnExit);
169+
public abstract boolean startJfrRecording(String name, String[] settings,
170+
String delay, String duration, Boolean disk, String path,
171+
String maxAge, String maxSize, Boolean dumpOnExit);
173172

174173
/**
175174
* Stops JFR recording.

visualvm/tools/src/org/graalvm/visualvm/tools/jmx/JmxModel.java

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -265,26 +265,25 @@ public void removePropertyChangeListener(PropertyChangeListener listener) {
265265
* @param name optional name that can be used to identify recording.
266266
* @param settings names of settings files to use, i.e. "default" or
267267
* "default.jfc".
268-
* @param delay delay before recording is started, in nanoseconds. Must be
269-
* at least 1 second.
270-
* @param duration duration of the recording, in nanoseconds. Must be at
271-
* least 1 second.
268+
* @param delay optional delay recording start with (s)econds, (m)inutes),
269+
* (h)ours), or (d)ays, e.g. 5h.
270+
* @param duration optional duration of recording in (s)econds, (m)inutes,
271+
* (h)ours, or (d)ays, e.g. 300s.
272272
* @param disk if recording should be persisted to disk
273273
* @param path file path where recording data should be written
274-
* @param maxAge how long recording data should be kept in the disk
275-
* repository, or <code>0</code> if no limit should be set.
276-
*
277-
* @param maxSize the minimum amount data to keep in the disk repository
278-
* before it is discarded, or <code>0</code> if no limit should be
279-
* set.
280-
*
274+
* @param maxAge optional maximum time to keep recorded data (on disk) in
275+
* (s)econds, (m)inutes, (h)ours, or (d)ays, e.g. 60m,
276+
* or <code>0</code> if no limit should be set.
277+
* @param maxSize optional maximum amount of bytes to keep (on disk) in
278+
* (k)B, (M)B or (G)B, e.g. 500M, or <code>0</code> if no
279+
* limit should be set.
281280
* @param dumpOnExit if recording should dump on exit
282281
*
283282
* @return true if recording was successfully started.
284283
*/
285-
public abstract boolean startJfrRecording(String name, String[] settings, Long delay,
286-
Long duration, Boolean disk, String path, Long maxAge, Long maxSize,
287-
Boolean dumpOnExit);
284+
public abstract boolean startJfrRecording(String name, String[] settings,
285+
String delay, String duration, Boolean disk, String path,
286+
String maxAge, String maxSize, Boolean dumpOnExit);
288287

289288
/**
290289
* Stops JFR recording.

0 commit comments

Comments
 (0)