<commit_before>package org.glassfish.grizzly.bm;

import org.glassfish.grizzly.Grizzly;
import org.glassfish.grizzly.http.server.HttpServer;
import org.glassfish.grizzly.http.server.NetworkListener;
import org.glassfish.grizzly.http.server.RequestExecutorProvider;
import org.glassfish.grizzly.nio.transport.TCPNIOTransport;

/**
 * HttpServer
 */
public class Server {
    public static final String SERVER_VERSION = "Grizzly/" + Grizzly.getDotedVersion();
    
    // The RequestExecutorProvider, which will run HTTP request processing
    // in the same thread
    static final RequestExecutorProvider EXECUTOR_PROVIDER =
            new RequestExecutorProvider.SameThreadProvider();
    
    public static void main(String[] args) throws Exception {
        final int port = args.length > 0
                ? Integer.parseInt(args[0]) : 8080;
        
        final HttpServer httpServer = new HttpServer();
        final NetworkListener networkListener = new NetworkListener(
                "http-listener", "0.0.0.0", port);
        final TCPNIOTransport transport = networkListener.getTransport();
        
        // force to not initialize worker thread pool
        transport.setWorkerThreadPoolConfig(null);
        transport.setSelectorRunnersCount(Runtime.getRuntime().availableProcessors());
        
        // always keep-alive
        networkListener.getKeepAlive().setIdleTimeoutInSeconds(-1);
        networkListener.getKeepAlive().setMaxRequestsCount(-1);
        
        // disable file-cache
        networkListener.getFileCache().setEnabled(false);
        
        httpServer.addListener(networkListener);
        
        httpServer.getServerConfiguration().addHttpHandler(
                new RootHttpHandler(), "/");
//        httpServer.getServerConfiguration().addHttpHandler(<commit_msg>+ double the number of I/O threads<commit_after>package org.glassfish.grizzly.bm;

import org.glassfish.grizzly.Grizzly;
import org.glassfish.grizzly.http.server.HttpServer;
import org.glassfish.grizzly.http.server.NetworkListener;
import org.glassfish.grizzly.http.server.RequestExecutorProvider;
import org.glassfish.grizzly.nio.transport.TCPNIOTransport;

/**
 * HttpServer
 */
public class Server {
    public static final String SERVER_VERSION = "Grizzly/" + Grizzly.getDotedVersion();
    
    // The RequestExecutorProvider, which will run HTTP request processing
    // in the same thread
    static final RequestExecutorProvider EXECUTOR_PROVIDER =
            new RequestExecutorProvider.SameThreadProvider();
    
    public static void main(String[] args) throws Exception {
        final int port = args.length > 0
                ? Integer.parseInt(args[0]) : 8080;
        
        final HttpServer httpServer = new HttpServer();
        final NetworkListener networkListener = new NetworkListener(
                "http-listener", "0.0.0.0", port);
        final TCPNIOTransport transport = networkListener.getTransport();
        
        // force to not initialize worker thread pool
        transport.setWorkerThreadPoolConfig(null);
        transport.setSelectorRunnersCount(Runtime.getRuntime().availableProcessors() * 2);
        
        // always keep-alive
        networkListener.getKeepAlive().setIdleTimeoutInSeconds(-1);
        networkListener.getKeepAlive().setMaxRequestsCount(-1);
        
        // disable file-cache
        networkListener.getFileCache().setEnabled(false);
        
        httpServer.addListener(networkListener);
        
        httpServer.getServerConfiguration().addHttpHandler(
                new RootHttpHandler(), "/");
//        httpServer.getServerConfiguration().addHttpHandler(
{'fraction_non_alphanumeric': 0.09309309309309309, 'fraction_numerical': 0.006825006825006825, 'mean_word_length': 3.017543859649123, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2495051', 'n_tokens_mistral': 975, 'n_tokens_neox': 960, 'n_words': 192}