equal
deleted
inserted
replaced
43 * extra MBeans with their listeners should not impact the dispatch |
43 * extra MBeans with their listeners should not impact the dispatch |
44 * time significantly. If it does, the test fails. |
44 * time significantly. If it does, the test fails. |
45 * |
45 * |
46 * As usual with timing-sensitive tests, we could potentially get |
46 * As usual with timing-sensitive tests, we could potentially get |
47 * sporadic failures. We fail if the ratio of the time with many |
47 * sporadic failures. We fail if the ratio of the time with many |
48 * MBeans to the time with just one MBean is more than 100. With the |
48 * MBeans to the time with just one MBean is more than 500. With the |
49 * fix in place, it is usually less than 1, presumably because some |
49 * fix in place, it is usually less than 1, presumably because some |
50 * code was being interpreted during the first measurement but had |
50 * code was being interpreted during the first measurement but had |
51 * been compiled by the second. |
51 * been compiled by the second. |
52 */ |
52 */ |
53 |
53 |
174 System.out.println(); |
174 System.out.println(); |
175 System.out.println("Timing a notification send now"); |
175 System.out.println("Timing a notification send now"); |
176 long manyMBeansTime = timeNotif(mbs); |
176 long manyMBeansTime = timeNotif(mbs); |
177 System.out.println("Time with many MBeans: " + manyMBeansTime + "ns"); |
177 System.out.println("Time with many MBeans: " + manyMBeansTime + "ns"); |
178 double ratio = (double) manyMBeansTime / singleMBeanTime; |
178 double ratio = (double) manyMBeansTime / singleMBeanTime; |
179 if (ratio > 100.0) |
179 if (ratio > 500.0) |
180 throw new Exception("Failed: ratio=" + ratio); |
180 throw new Exception("Failed: ratio=" + ratio); |
181 System.out.println("Test passed: ratio=" + ratio); |
181 System.out.println("Test passed: ratio=" + ratio); |
182 } |
182 } |
183 } |
183 } |