| <!DOCTYPE html> <!-- HTML5 doctype --> |
| |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| --> |
| |
| <html> |
| |
| <head> |
| <title>Proton Messenger Send Benchmark</title> |
| <meta http-equiv="content-type" content="text/html;charset=utf-8" /> |
| |
| <!-- |
| Import the Messenger Binding proton.js. Note that this simple example pulls |
| it from the node_modules/qpid-proton/lib, which is created by the build process |
| so that the node.js based examples "just work", in a real Web App you would |
| clearly need to copy the proton.js to your own server. |
| |
| In actual fact the CMake build actually builds proton.js into the directory: |
| <build>/proton-c/bindings/javascript |
| where <build> is the build directory created to run cmake from, it is then |
| copied to the node_modules/qpid-proton/lib directory. |
| |
| In this example we also set the global variable PROTON_TOTAL_MEMORY in order to |
| increase the virtual heap available to the emscripten compiled C runtime. It |
| is not really necessary to do this for this application as the default value |
| of 16777216 is fine, it is simply done here to illustrate how to do it. |
| --> |
| <script type="text/javascript">PROTON_TOTAL_MEMORY = 140000000;</script> |
| <script type="text/javascript">PROTON_TOTAL_STACK = 25000000;</script> |
| <script type="text/javascript" src="../../node_modules/qpid-proton-messenger/lib/proton-messenger.js"></script> |
| <script type="text/javascript" src="./msgr-send-common.js"></script> |
| |
| <script type="text/javascript"> |
| |
| var start = function() { |
| var opts = {}; |
| opts.addresses = document.getElementById("address").value; |
| opts.messageCount = parseInt(document.getElementById("messageCount").value, 10); |
| opts.messageSize = parseInt(document.getElementById("messageSize").value, 10); |
| opts.sendBatch = parseInt(document.getElementById("sendBatch").value, 10); |
| |
| opts.recvCount = -1; |
| opts.outgoingWindow; |
| opts.reportInterval = 0; |
| opts.getReplies = false; |
| opts.name; |
| opts.verbose = false; |
| |
| var sender = new MessengerSend(opts); |
| sender.start(); |
| }; |
| |
| </script> |
| |
| <style> |
| body |
| { |
| font: 13px/1.5 Helvetica, Arial, 'Liberation Sans', FreeSans, sans-serif; |
| overflow-x: hidden; /* Hide horizontal scrollbar */ |
| background: #dddddd; |
| } |
| |
| label |
| { |
| display: block; |
| font-size: 17px; |
| } |
| |
| input, textarea |
| { |
| font-size: 13px; |
| margin-bottom: 10px; |
| } |
| </style> |
| |
| </head> |
| |
| <body> |
| <div> |
| <label for="address">Address:</label> |
| <input type="text" id="address" size="40" |
| placeholder="amqp://user:password@host:port" |
| name="address" value="amqp://guest:guest@0.0.0.0" /> |
| </div> |
| <div> |
| <label for="messageCount">Message Count:</label> |
| <input type="text" id="messageCount" size="40" |
| name="messageCount" value="0" /> |
| </div> |
| <div> |
| <label for="messageSize">Message Size:</label> |
| <input type="text" id="messageSize" size="40" |
| name="messageSize" value="1024" /> |
| </div> |
| <div> |
| <label for="sendBatch">Send Batch Size:</label> |
| <input type="text" id="sendBatch" size="40" |
| name="sendBatch" value="1024" /> |
| </div> |
| |
| |
| <div> |
| <input type="button" value="start" onclick="start()"/> |
| </div> |
| </body> |
| |
| </html> |