9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 6338874
27 * @summary Check that notification dispatch is not linear in number of MBeans.
28 * @author Eamonn McManus
29 * @modules java.management
30 *
31 * @library /lib/testlibrary
32 * @run build jdk.testlibrary.* ListenerScaleTest
33 * @run main ListenerScaleTest
34 */
35
36 /*
37 * The notification dispatch logic in the connector server used to be
38 * linear in the number of listeners there were on any MBean. For
39 * example, if there were 1000 MBeans, each with one listener, then
40 * every time a notification was sent it would be compared against
41 * every one of the 1000 MBeans, even though its source ObjectName was
42 * known and could not possibly match the name of 999 of the MBeans.
43 * This test checks that we no longer have linear behaviour. We do
44 * this by registering just one MBean and measuring the time it takes
45 * to send and receive a certain number of notifications from that
46 * MBean. Then we register many other MBeans, each with a listener,
47 * and we make the same measurement as before. The presence of the
48 * extra MBeans with their listeners should not impact the dispatch
49 * time significantly. If it does, the test fails.
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 6338874
27 * @summary Check that notification dispatch is not linear in number of MBeans.
28 * @author Eamonn McManus
29 * @modules java.management.rmi
30 *
31 * @library /lib/testlibrary
32 * @run build jdk.testlibrary.* ListenerScaleTest
33 * @run main ListenerScaleTest
34 */
35
36 /*
37 * The notification dispatch logic in the connector server used to be
38 * linear in the number of listeners there were on any MBean. For
39 * example, if there were 1000 MBeans, each with one listener, then
40 * every time a notification was sent it would be compared against
41 * every one of the 1000 MBeans, even though its source ObjectName was
42 * known and could not possibly match the name of 999 of the MBeans.
43 * This test checks that we no longer have linear behaviour. We do
44 * this by registering just one MBean and measuring the time it takes
45 * to send and receive a certain number of notifications from that
46 * MBean. Then we register many other MBeans, each with a listener,
47 * and we make the same measurement as before. The presence of the
48 * extra MBeans with their listeners should not impact the dispatch
49 * time significantly. If it does, the test fails.
|