SHINDIG-1056 by lipeng, BasicRemoteContentTest doesn't depend on static private key...
[shindig.git] / javascript / container / rpctest_gadget.html
blob2411285db880b3b3b1978f3be94ee93d52e17409
1 <!--
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 -->
19 <html>
20 <head>
21 <title>gadgets.rpc Performance Tests: Gadget</title>
22 <script>
23 // Fake a version of gadgets.config that rpc.js uses for configuration.
24 var gadgets = {};
25 gadgets.config = {
26 register: function(rpc, requiredConfig, callback) {
27 // rpc === "rpc", requiredConfig is ignored here.
28 // Just call the callback (function init(...) in rpc.js)
29 // with a dummy config object.
30 callback({ rpc: { parentRelayUrl: "" } });
33 </script>
34 <script src="../../js/rpc.js?c=1&debug=1"></script>
35 <script src="rpctest_perf.js"></script>
36 <script>
37 var containerRelay = window.location.search.substring(1);
38 gadgets.rpc.setRelayUrl(null, containerRelay);
39 </script>
40 </head>
41 <body onload="initPerfTest();">
42 <div>gadgets.rpc Performance: "Gadget" page</div><hr/>
43 <div>Test<br/>
44 <ul>
45 <li>Number of messages to send:
46 <select name="num_msgs" id="num_msgs">
47 <option value="1">1</option>
48 <option value="10">10</option>
49 <option value="100" selected>100</option>
50 <option value="1000">1000</option>
51 </select>
52 </li>
53 <li>Message size:
54 <select name="msg_size" id="msg_size">
55 <option value="10">10 B</option>
56 <option value="100">100 B</option>
57 <option value="1024" selected>1 kB</option>
58 <option value="10240">10 kB</option>
59 <option value="102400">100 kB</option>
60 <option value="1048576">1 MB</option>
61 </select>
62 </li>
63 <li>
64 <input type="button" value="Start The Test!" onclick="runPerfTest();" />
65 </li>
66 </ul>
67 </div>
68 <div id="test_running" style="display:none;">
69 Running test...
70 </div>
71 <div id="results" style="display:none;">
72 Results: Gadget-to-Container<br/>
73 Messages: <span id="results_num_received"></span>, Bytes: <span id="results_bytes_received"></span> <span id="in_or_out"></span><br/>
74 Time elapsed for test run: <span id="results_time_used"></span><br/>
75 Messages/second: <span id="results_msgs_per_sec"></span><br/>
76 Bytes/second: <span id="results_bytes_per_sec"></span>
77 </div>
78 <script>gadgets.util.runOnLoadHandlers();</script>
79 </body>
80 </html>