< prev index next >
test/jdk/sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java
Print this page
*** 42,52 ****
(HotspotRuntimeMBean)ManagementFactoryHelper.getHotspotRuntimeMBean();
private static final long NUM_THREAD_DUMPS = 300;
// Careful with these values.
! private static final long MIN_VALUE_FOR_PASS = 1;
private static final long MAX_VALUE_FOR_PASS = Long.MAX_VALUE;
public static void main(String args[]) throws Exception {
long count = mbean.getSafepointCount();
long value = mbean.getSafepointSyncTime();
--- 42,52 ----
(HotspotRuntimeMBean)ManagementFactoryHelper.getHotspotRuntimeMBean();
private static final long NUM_THREAD_DUMPS = 300;
// Careful with these values.
! private static final long MIN_VALUE_FOR_PASS = 0;
private static final long MAX_VALUE_FOR_PASS = Long.MAX_VALUE;
public static void main(String args[]) throws Exception {
long count = mbean.getSafepointCount();
long value = mbean.getSafepointSyncTime();
*** 79,89 ****
long value2 = mbean.getSafepointSyncTime();
System.out.format("Safepoint count=%d (diff=%d), sync time=%d ms (diff=%d)%n",
count2, count2-count1, value2, value2-value1);
! if (value2 <= value1) {
throw new RuntimeException("Safepoint sync time " +
"did not increase " +
"(value1 = " + value1 + "; " +
"value2 = " + value2 + ")");
}
--- 79,89 ----
long value2 = mbean.getSafepointSyncTime();
System.out.format("Safepoint count=%d (diff=%d), sync time=%d ms (diff=%d)%n",
count2, count2-count1, value2, value2-value1);
! if (value2 < value1) {
throw new RuntimeException("Safepoint sync time " +
"did not increase " +
"(value1 = " + value1 + "; " +
"value2 = " + value2 + ")");
}
< prev index next >