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
21 <title>gadgets.rpc Performance Tests: Gadget
</title>
23 // Fake a version of gadgets.config that rpc.js uses for configuration.
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
: "" } });
34 <script src=
"../../js/rpc.js?c=1&debug=1"></script>
35 <script src=
"rpctest_perf.js"></script>
37 var containerRelay
= window
.location
.search
.substring(1);
38 gadgets
.rpc
.setRelayUrl(null, containerRelay
);
41 <body onload=
"initPerfTest();">
42 <div>gadgets.rpc Performance:
"Gadget" page
</div><hr/>
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>
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>
64 <input type=
"button" value=
"Start The Test!" onclick=
"runPerfTest();" />
68 <div id=
"test_running" style=
"display:none;">
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>
78 <script>gadgets
.util
.runOnLoadHandlers();</script>