<commit_before>#include <iostream>
#include <boost/asio.hpp>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/service.h>

#include "vtrc-common/vtrc-thread-pool.h"
#include "vtrc-common/vtrc-exception.h"

#include "vtrc-client-base/vtrc-client.h"
#include "protocol/vtrc-rpc-lowlevel.pb.h"

#include <boost/random.hpp>
#include <boost/random/random_device.hpp>

#include "vtrc-thread.h"
#include "vtrc-chrono.h"

void on_connect( const boost::system::error_code &err )
{
    std::cout << "connected "
              << err.value( ) << " "
              << err.message( ) << "\n";
}

using namespace vtrc;

int main( )
{
    common::thread_pool tp(4);
    vtrc::shared_ptr<client::vtrc_client> cl(
                          client::vtrc_client::create((tp.get_io_service( ))));

    ///cl.connect( "127.0.0.1", "44667" );
    cl->async_connect( "127.0.0.1", "44667", on_connect );

    vtrc::this_thread::sleep_for( vtrc::chrono::milliseconds(2000) );

    vtrc::shared_ptr<google::protobuf::RpcChannel> ch(cl->get_channel( ));
    vtrc_rpc_lowlevel::test_rpc::Stub s( ch.get( ) );

    vtrc_rpc_lowlevel::message_info mi;

    for( int i=0; i<200000000; ++i ) {
        try {
            s.test( NULL, &mi, &mi, NULL );
            std::cout << "response: " << mi.message_type( ) << "\n";
            cl.reset( );
            //return 0;
        } catch( const vtrc::common::exception &ex ) {

            std::cout << "call error: "
                      << " code (" << ex.code( ) << ")"
                      << " category (" << ex.category( ) << ")"
                      << " what: " << ex.what( )
                      << " (" << ex.additional( ) << ")"
                      << "\n";
        } catch( const std::exception &ex ) {
            std::cout << "call error: " << ex.what( ) << "\n";
        }<commit_msg>protocol<commit_after>#include <iostream>
#include <boost/asio.hpp>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/service.h>

#include "vtrc-common/vtrc-thread-pool.h"
#include "vtrc-common/vtrc-exception.h"

#include "vtrc-client-base/vtrc-client.h"
#include "protocol/vtrc-rpc-lowlevel.pb.h"

#include <boost/random.hpp>
#include <boost/random/random_device.hpp>

#include "vtrc-thread.h"
#include "vtrc-chrono.h"

void on_connect( const boost::system::error_code &err )
{
    std::cout << "connected "
              << err.value( ) << " "
              << err.message( ) << "\n";
}

using namespace vtrc;

int main( )
{
    common::thread_pool tp(4);
    vtrc::shared_ptr<client::vtrc_client> cl(
                          client::vtrc_client::create((tp.get_io_service( ))));

    ///cl.connect( "127.0.0.1", "44667" );
    cl->async_connect( "127.0.0.1", "44667", on_connect );

    vtrc::this_thread::sleep_for( vtrc::chrono::milliseconds(2000) );

    vtrc::shared_ptr<google::protobuf::RpcChannel> ch(cl->get_channel( ));
    vtrc_rpc_lowlevel::test_rpc::Stub s( ch.get( ) );

    vtrc_rpc_lowlevel::message_info mi;

    for( int i=0; i<200000000; ++i ) {
        try {
            s.test( NULL, &mi, &mi, NULL );
            std::cout << "response: " << mi.message_type( ) << "\n";
        } catch( const vtrc::common::exception &ex ) {

            std::cout << "call error: "
                      << " code (" << ex.code( ) << ")"
                      << " category (" << ex.category( ) << ")"
                      << " what: " << ex.what( )
                      << " (" << ex.additional( ) << ")"
                      << "\n";
        } catch( const std::exception &ex ) {
            std::cout << "call error: " << ex.what( ) << "\n";
        }
{'fraction_non_alphanumeric': 0.19475138121546962, 'fraction_numerical': 0.020718232044198894, 'mean_word_length': 2.315934065934066, 'pattern_counts': {'":': 0, '<': 117, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 2, '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': '4594376', 'n_tokens_mistral': 1343, 'n_tokens_neox': 1278, 'n_words': 201}