Home / File/ WebSocketServerBenchmarkPage.java — netty Source File

WebSocketServerBenchmarkPage.java — netty Source File

Architecture documentation for WebSocketServerBenchmarkPage.java, a java file in the netty codebase.

Entity Profile

Relationship Graph

Source Code

/*
 * Copyright 2014 The Netty Project
 *
 * The Netty Project 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:
 *
 *   https://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.
 */
package io.netty.example.http.websocketx.benchmarkserver;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.util.CharsetUtil;

/**
 * Generates the benchmark HTML page which is served at http://localhost:8080/
 */
public final class WebSocketServerBenchmarkPage {

    private static final String NEWLINE = "\r\n";

    public static ByteBuf getContent(String webSocketLocation) {
        return Unpooled.copiedBuffer(
                "<html><head><title>Web Socket Performance Test</title></head>" + NEWLINE +
                "<body>" + NEWLINE +
                "<h2>WebSocket Performance Test</h2>" + NEWLINE +
                "<label>Connection Status:</label>" + NEWLINE +
                "<label id=\"connectionLabel\"></label><br />" + NEWLINE +

                "<form onsubmit=\"return false;\">" + NEWLINE +
                "Message size:" +
                "<input type=\"text\" id=\"messageSize\" value=\"1024\"/><br>" + NEWLINE +
                "Number of messages:" +
                "<input type=\"text\" id=\"nrMessages\" value=\"100000\"/><br>" + NEWLINE +
                "Data Type:" +
                "<input type=\"radio\" name=\"type\" id=\"typeText\" value=\"text\" checked>text" +
                "<input type=\"radio\" name=\"type\" id=\"typeBinary\" value=\"binary\">binary<br>" + NEWLINE +
                "Mode:<br>" + NEWLINE +
                "<input type=\"radio\" name=\"mode\" id=\"modeSingle\" value=\"single\" checked>" +
                "Wait for response after each messages<br>" + NEWLINE +
                "<input type=\"radio\" name=\"mode\" id=\"modeAll\" value=\"all\">" +
                "Send all messages and then wait for all responses<br>" + NEWLINE +
                "<input type=\"checkbox\" id=\"verifiyResponses\">Verify responded messages<br>" + NEWLINE +
                "<input type=\"button\" value=\"Start Benchmark\"" + NEWLINE +
                "       onclick=\"startBenchmark()\" />" + NEWLINE +
                "<h3>Output</h3>" + NEWLINE +
                "<textarea id=\"output\" style=\"width:500px;height:300px;\"></textarea>" + NEWLINE +
                "<br>" + NEWLINE +
                "<input type=\"button\" value=\"Clear\" onclick=\"clearText()\">" + NEWLINE +
                "</form>" + NEWLINE +

                "<script type=\"text/javascript\">" + NEWLINE +
                "var benchRunning = false;" + NEWLINE +
// ... (132 more lines)

Domain

Subdomains

Frequently Asked Questions

What does WebSocketServerBenchmarkPage.java do?
WebSocketServerBenchmarkPage.java is a source file in the netty codebase, written in java. It belongs to the Buffer domain, Allocators subdomain.
Where is WebSocketServerBenchmarkPage.java in the architecture?
WebSocketServerBenchmarkPage.java is located at example/src/main/java/io/netty/example/http/websocketx/benchmarkserver/WebSocketServerBenchmarkPage.java (domain: Buffer, subdomain: Allocators, directory: example/src/main/java/io/netty/example/http/websocketx/benchmarkserver).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free