<commit_before>#!/usr/bin/env php
<?php

require_once './WebSocketServer.php';

/**
 * Echo server
 */
class SpeedTestServer extends WebSocketServer
{
    public function __construct($addr, $port)
    {
        $this->data = $this->generateRandomString(20 * 1024 * 1024);;
        parent::__construct($addr, $port);
    }

    function generateRandomString($length = 10)
    {
        $characters = '0123456789abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
        $charactersLength = strlen($characters);
        $randomString = '';
        for ($i = 0; $i < $length; $i++) {
            $randomString .= $characters[rand(0, $charactersLength - 1)];
        }
        return $randomString;
    }

    /**
     * Undocumented function
     *
     * @param WebSocketUser $user    The user<commit_msg>Reduce websocket chunks to 128k<commit_after>#!/usr/bin/env php
<?php

require_once './WebSocketServer.php';

/**
 * Echo server
 */
class SpeedTestServer extends WebSocketServer
{
    public function __construct($addr, $port)
    {
        $this->data = $this->generateRandomString(128 * 1024);;
        parent::__construct($addr, $port);
    }

    function generateRandomString($length = 10)
    {
        $characters = '0123456789abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
        $charactersLength = strlen($characters);
        $randomString = '';
        for ($i = 0; $i < $length; $i++) {
            $randomString .= $characters[rand(0, $charactersLength - 1)];
        }
        return $randomString;
    }

    /**
     * Undocumented function
     *
     * @param WebSocketUser $user    The user
{'fraction_non_alphanumeric': 0.1336206896551724, 'fraction_numerical': 0.03078817733990148, 'mean_word_length': 2.7703016241299303, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '2187093', 'n_tokens_mistral': 564, 'n_tokens_neox': 501, 'n_words': 98}