Java Code Examples for jdk.management.jfr.FlightRecorderMXBean#getRecordings()
The following examples show how to use
jdk.management.jfr.FlightRecorderMXBean#getRecordings() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestSnapshot.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
private static void testStopped() throws IOException { try (Recording r = new Recording()) { r.enable(SimpleEvent.class); r.start(); SimpleEvent se = new SimpleEvent(); se.commit(); r.stop(); try (Recording snapshot = FlightRecorder.getFlightRecorder().takeSnapshot()) { r.close(); FlightRecorderMXBean mxBean = JmxHelper.getFlighteRecorderMXBean(); List<RecordingInfo> recs = mxBean.getRecordings(); JmxHelper.verifyEquals(recs.get(0), snapshot); } } }
Example 2
Source File: TestRecordingState.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Throwable { FlightRecorderMXBean bean = JmxHelper.getFlighteRecorderMXBean(); List<RecordingInfo> preCreateRecordings = bean.getRecordings(); long recId = bean.newRecording(); JmxHelper.verifyNotExists(recId, preCreateRecordings); JmxHelper.verifyState(recId, RecordingState.NEW, bean); bean.startRecording(recId); JmxHelper.verifyState(recId, RecordingState.RUNNING, bean); bean.stopRecording(recId); JmxHelper.verifyState(recId, RecordingState.STOPPED, bean); bean.closeRecording(recId); JmxHelper.verifyNotExists(recId, bean.getRecordings()); }
Example 3
Source File: TestRecordingState.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Throwable { FlightRecorderMXBean bean = JmxHelper.getFlighteRecorderMXBean(); List<RecordingInfo> preCreateRecordings = bean.getRecordings(); long recId = bean.newRecording(); JmxHelper.verifyNotExists(recId, preCreateRecordings); JmxHelper.verifyState(recId, RecordingState.NEW, bean); bean.startRecording(recId); JmxHelper.verifyState(recId, RecordingState.RUNNING, bean); bean.stopRecording(recId); JmxHelper.verifyState(recId, RecordingState.STOPPED, bean); bean.closeRecording(recId); JmxHelper.verifyNotExists(recId, bean.getRecordings()); }
Example 4
Source File: TestSnapshot.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
private static void testStopped() throws IOException { try (Recording r = new Recording()) { r.enable(SimpleEvent.class); r.start(); SimpleEvent se = new SimpleEvent(); se.commit(); r.stop(); try (Recording snapshot = FlightRecorder.getFlightRecorder().takeSnapshot()) { r.close(); FlightRecorderMXBean mxBean = JmxHelper.getFlighteRecorderMXBean(); List<RecordingInfo> recs = mxBean.getRecordings(); JmxHelper.verifyEquals(recs.get(0), snapshot); } } }
Example 5
Source File: TestRecordingState.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Throwable { FlightRecorderMXBean bean = JmxHelper.getFlighteRecorderMXBean(); List<RecordingInfo> preCreateRecordings = bean.getRecordings(); long recId = bean.newRecording(); JmxHelper.verifyNotExists(recId, preCreateRecordings); JmxHelper.verifyState(recId, RecordingState.NEW, bean); bean.startRecording(recId); JmxHelper.verifyState(recId, RecordingState.RUNNING, bean); bean.stopRecording(recId); JmxHelper.verifyState(recId, RecordingState.STOPPED, bean); bean.closeRecording(recId); JmxHelper.verifyNotExists(recId, bean.getRecordings()); }
Example 6
Source File: TestSnapshot.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private static void testEmpty() throws IOException { try (Recording snapshot = FlightRecorder.getFlightRecorder().takeSnapshot()) { FlightRecorderMXBean mxBean = JmxHelper.getFlighteRecorderMXBean(); List<RecordingInfo> recs = mxBean.getRecordings(); JmxHelper.verifyEquals(recs.get(0), snapshot); } }
Example 7
Source File: TestGetRecordings.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) throws Throwable { FlightRecorderMXBean bean =JmxHelper.getFlighteRecorderMXBean(); List<RecordingInfo> preCreateRecordings = bean.getRecordings(); long recId = bean.newRecording(); JmxHelper.verifyNotExists(recId, preCreateRecordings); bean.closeRecording(recId); JmxHelper.verifyNotExists(recId, bean.getRecordings()); }
Example 8
Source File: TestMultipleRecordings.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private static long createRecording(FlightRecorderMXBean bean) throws Exception { List<RecordingInfo> preCreateRecordings = bean.getRecordings(); long recId = bean.newRecording(); JmxHelper.verifyNotExists(recId, preCreateRecordings); JmxHelper.verifyState(recId, RecordingState.NEW, bean); return recId; }
Example 9
Source File: TestSnapshot.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private static void testEmpty() throws IOException { try (Recording snapshot = FlightRecorder.getFlightRecorder().takeSnapshot()) { FlightRecorderMXBean mxBean = JmxHelper.getFlighteRecorderMXBean(); List<RecordingInfo> recs = mxBean.getRecordings(); JmxHelper.verifyEquals(recs.get(0), snapshot); } }
Example 10
Source File: TestClone.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) throws Exception { FlightRecorderMXBean bean = JmxHelper.getFlighteRecorderMXBean(); long orgId = bean.newRecording(); bean.startRecording(orgId); SimpleEventHelper.createEvent(1); // Should be in both org and clone long cloneId = bean.cloneRecording(orgId, false); Asserts.assertNotEquals(orgId, cloneId, "clone id should not be same as org id"); List<RecordingInfo> recordings = bean.getRecordings(); JmxHelper.verifyState(orgId, RecordingState.RUNNING, recordings); JmxHelper.verifyState(cloneId, RecordingState.RUNNING, recordings); bean.stopRecording(orgId); recordings = bean.getRecordings(); JmxHelper.verifyState(orgId, RecordingState.STOPPED, recordings); JmxHelper.verifyState(cloneId, RecordingState.RUNNING, recordings); SimpleEventHelper.createEvent(2); // Should only be in clone bean.stopRecording(cloneId); recordings = bean.getRecordings(); JmxHelper.verifyState(orgId, RecordingState.STOPPED, recordings); JmxHelper.verifyState(cloneId, RecordingState.STOPPED, recordings); Path orgPath = Paths.get(".", "org.jfr"); Path clonePath = Paths.get(".", "clone.jfr"); bean.copyTo(orgId, orgPath.toString()); bean.copyTo(cloneId, clonePath.toString()); verifyEvents(orgPath, 1); verifyEvents(clonePath, 1, 2); bean.closeRecording(orgId); bean.closeRecording(cloneId); }
Example 11
Source File: TestRecordingStateInvalid.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private static long createRecording(FlightRecorderMXBean bean) throws Exception { List<RecordingInfo> preCreateRecordings = bean.getRecordings(); long recId = bean.newRecording(); JmxHelper.verifyNotExists(recId, preCreateRecordings); JmxHelper.verifyState(recId, RecordingState.NEW, bean); return recId; }
Example 12
Source File: TestGetRecordings.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) throws Throwable { FlightRecorderMXBean bean =JmxHelper.getFlighteRecorderMXBean(); List<RecordingInfo> preCreateRecordings = bean.getRecordings(); long recId = bean.newRecording(); JmxHelper.verifyNotExists(recId, preCreateRecordings); bean.closeRecording(recId); JmxHelper.verifyNotExists(recId, bean.getRecordings()); }
Example 13
Source File: TestMultipleRecordings.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private static long createRecording(FlightRecorderMXBean bean) throws Exception { List<RecordingInfo> preCreateRecordings = bean.getRecordings(); long recId = bean.newRecording(); JmxHelper.verifyNotExists(recId, preCreateRecordings); JmxHelper.verifyState(recId, RecordingState.NEW, bean); return recId; }
Example 14
Source File: TestClone.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) throws Exception { FlightRecorderMXBean bean = JmxHelper.getFlighteRecorderMXBean(); long orgId = bean.newRecording(); bean.startRecording(orgId); SimpleEventHelper.createEvent(1); // Should be in both org and clone long cloneId = bean.cloneRecording(orgId, false); Asserts.assertNotEquals(orgId, cloneId, "clone id should not be same as org id"); List<RecordingInfo> recordings = bean.getRecordings(); JmxHelper.verifyState(orgId, RecordingState.RUNNING, recordings); JmxHelper.verifyState(cloneId, RecordingState.RUNNING, recordings); bean.stopRecording(orgId); recordings = bean.getRecordings(); JmxHelper.verifyState(orgId, RecordingState.STOPPED, recordings); JmxHelper.verifyState(cloneId, RecordingState.RUNNING, recordings); SimpleEventHelper.createEvent(2); // Should only be in clone bean.stopRecording(cloneId); recordings = bean.getRecordings(); JmxHelper.verifyState(orgId, RecordingState.STOPPED, recordings); JmxHelper.verifyState(cloneId, RecordingState.STOPPED, recordings); Path orgPath = Paths.get(".", "org.jfr"); Path clonePath = Paths.get(".", "clone.jfr"); bean.copyTo(orgId, orgPath.toString()); bean.copyTo(cloneId, clonePath.toString()); verifyEvents(orgPath, 1); verifyEvents(clonePath, 1, 2); bean.closeRecording(orgId); bean.closeRecording(cloneId); }
Example 15
Source File: TestRecordingStateInvalid.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
private static long createRecording(FlightRecorderMXBean bean) throws Exception { List<RecordingInfo> preCreateRecordings = bean.getRecordings(); long recId = bean.newRecording(); JmxHelper.verifyNotExists(recId, preCreateRecordings); JmxHelper.verifyState(recId, RecordingState.NEW, bean); return recId; }
Example 16
Source File: TestGetRecordings.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) throws Throwable { FlightRecorderMXBean bean =JmxHelper.getFlighteRecorderMXBean(); List<RecordingInfo> preCreateRecordings = bean.getRecordings(); long recId = bean.newRecording(); JmxHelper.verifyNotExists(recId, preCreateRecordings); bean.closeRecording(recId); JmxHelper.verifyNotExists(recId, bean.getRecordings()); }
Example 17
Source File: TestMultipleRecordings.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
private static long createRecording(FlightRecorderMXBean bean) throws Exception { List<RecordingInfo> preCreateRecordings = bean.getRecordings(); long recId = bean.newRecording(); JmxHelper.verifyNotExists(recId, preCreateRecordings); JmxHelper.verifyState(recId, RecordingState.NEW, bean); return recId; }
Example 18
Source File: TestSnapshot.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
private static void testEmpty() throws IOException { try (Recording snapshot = FlightRecorder.getFlightRecorder().takeSnapshot()) { FlightRecorderMXBean mxBean = JmxHelper.getFlighteRecorderMXBean(); List<RecordingInfo> recs = mxBean.getRecordings(); JmxHelper.verifyEquals(recs.get(0), snapshot); } }
Example 19
Source File: TestRecordingStateInvalid.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private static long createRecording(FlightRecorderMXBean bean) throws Exception { List<RecordingInfo> preCreateRecordings = bean.getRecordings(); long recId = bean.newRecording(); JmxHelper.verifyNotExists(recId, preCreateRecordings); JmxHelper.verifyState(recId, RecordingState.NEW, bean); return recId; }
Example 20
Source File: TestClone.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) throws Exception { FlightRecorderMXBean bean = JmxHelper.getFlighteRecorderMXBean(); long orgId = bean.newRecording(); bean.startRecording(orgId); SimpleEventHelper.createEvent(1); // Should be in both org and clone long cloneId = bean.cloneRecording(orgId, false); Asserts.assertNotEquals(orgId, cloneId, "clone id should not be same as org id"); List<RecordingInfo> recordings = bean.getRecordings(); JmxHelper.verifyState(orgId, RecordingState.RUNNING, recordings); JmxHelper.verifyState(cloneId, RecordingState.RUNNING, recordings); bean.stopRecording(orgId); recordings = bean.getRecordings(); JmxHelper.verifyState(orgId, RecordingState.STOPPED, recordings); JmxHelper.verifyState(cloneId, RecordingState.RUNNING, recordings); SimpleEventHelper.createEvent(2); // Should only be in clone bean.stopRecording(cloneId); recordings = bean.getRecordings(); JmxHelper.verifyState(orgId, RecordingState.STOPPED, recordings); JmxHelper.verifyState(cloneId, RecordingState.STOPPED, recordings); Path orgPath = Paths.get(".", "org.jfr"); Path clonePath = Paths.get(".", "clone.jfr"); bean.copyTo(orgId, orgPath.toString()); bean.copyTo(cloneId, clonePath.toString()); verifyEvents(orgPath, 1); verifyEvents(clonePath, 1, 2); bean.closeRecording(orgId); bean.closeRecording(cloneId); }