<commit_before>#ifndef MONITOR_HPP
#define MONITOR_HPP

#include <chrono>
#include "server.hpp"

namespace fs{

class Monitor
{
public:
    Monitor(const Server* s):
        server_{s},
        this_thread_{   [this]{run();}}
    {}

    void run() const
    {
        do_run();
    }

    ~Monitor()
    {
        this_thread_.join();
    }

private:
    const Server* server_;
    std::thread this_thread_;

    void do_run() const
    {
        while(server_)
        {
            std::this_thread::sleep_for(std::chrono::milliseconds{1500});

            std::string info{"threads : ["};
            info += std::to_string(server_->threads_vector_.size());
            info += "]   data sockets : [";
            info += std::to_string(server_->data_sockets_->size());
            info += "]";
            server_->print_safely(info) << std::endl;
        }
    }
};

}//namespace
#endif // MONITOR_HPP<commit_msg>format 	modified:   ftp/monitor.hpp<commit_after>#ifndef MONITOR_HPP
#define MONITOR_HPP

#include <chrono>
#include "server.hpp"


namespace fs{

class Monitor
{
public:
    Monitor(const Server* s):
        server_{s},
        this_thread_{   [this]{run();}  }
    {}

    void run() const
    {
        do_run();
    }

    ~Monitor()
    {
        this_thread_.join();
    }

private:
    const Server* server_;
    std::thread this_thread_;

    void do_run() const
    {
        while(server_)
        {
            std::this_thread::sleep_for(std::chrono::milliseconds{1200});

            std::string stat{"threads : ["};
            stat += std::to_string(server_->threads_vector_.size());
            stat += "]   data sockets : [";
            stat += std::to_string(server_->data_sockets_->size());
            stat += "]";
            server_->print_safely(stat) << std::endl;
        }
    }
};

}//namespace
#endif // MONITOR_HPP
{'fraction_non_alphanumeric': 0.1529790660225443, 'fraction_numerical': 0.0042941492216854536, 'mean_word_length': 2.164685908319185, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '5474178', 'n_tokens_mistral': 615, 'n_tokens_neox': 590, 'n_words': 103}