<commit_before>#include <evnsq/exp.h>
#include <evnsq/consumer.h>
#include <evnsq/producer.h>
#include <evpp/event_loop.h>

#include <getopt.h>

int OnMessage(const evnsq::Message* msg) {
    LOG_INFO << "Received a message, id=" << msg->id << " message=[" << msg->body.ToString() << "]";
    return 0;
}

void Publish(evnsq::Producer* producer) {
    static const std::string topic = "test";
    static int i = 0;
    std::stringstream ss;
    ss << "a NSQ message, index=" << i++;
    std::string msg = ss.str();
    producer->Publish(topic, msg);
    LOG_INFO << "Publish : [" << msg << "]";
    std::vector<std::string> messages;
    messages.push_back(msg);
    messages.push_back(msg);
    producer->MultiPublish(topic, messages);
}

void OnReady(evpp::EventLoop* loop, evnsq::Producer* p) {
    loop->RunEvery(evpp::Duration(1.0), std::bind(&Publish, p));
//     for (int i = 0; i < 20; i++) {
//         Publish(p);
//     }
}


int main(int argc, char* argv[]) {
    int opt = 0;
    int digit_optind = 0;
    int option_index = 0;
    char* optstring = "t:h:";
    static struct option long_options[] = {
        { "nsqd_tcp_addr", required_argument, NULL, 't' },
        { "lookupd_http_addr", required_argument, NULL, 'h' },
        { 0, 0, 0, 0 }
    };

    std::string nsqd_tcp_addr;
    std::string lookupd_http_url;

    //nsqd_tcp_addr = "127.0.0.1:4150";
    nsqd_tcp_addr = "10.16.28.17:4150";
    //nsqd_tcp_addr = "weizili-L1:4150";
    //lookupd_http_url = "http://127.0.0.1:4161/lookup?topic=test";
    lookupd_http_url = "http://10.16.28.17:4161/lookup?topic=test";

    while ((opt = getopt_long(argc, argv, optstring, long_options, &option_index)) != -1) {
        switch (opt) {
        case 't':
            nsqd_tcp_addr = optarg;
            break;

        case 'h':
            lookupd_http_url = optarg;<commit_msg>Fix compile warning<commit_after>#include <evnsq/exp.h>
#include <evnsq/consumer.h>
#include <evnsq/producer.h>
#include <evpp/event_loop.h>

#include <getopt.h>

int OnMessage(const evnsq::Message* msg) {
    LOG_INFO << "Received a message, id=" << msg->id << " message=[" << msg->body.ToString() << "]";
    return 0;
}

void Publish(evnsq::Producer* producer) {
    static const std::string topic = "test";
    static int i = 0;
    std::stringstream ss;
    ss << "a NSQ message, index=" << i++;
    std::string msg = ss.str();
    producer->Publish(topic, msg);
    LOG_INFO << "Publish : [" << msg << "]";
    std::vector<std::string> messages;
    messages.push_back(msg);
    messages.push_back(msg);
    producer->MultiPublish(topic, messages);
}

void OnReady(evpp::EventLoop* loop, evnsq::Producer* p) {
    loop->RunEvery(evpp::Duration(1.0), std::bind(&Publish, p));
//     for (int i = 0; i < 20; i++) {
//         Publish(p);
//     }
}


int main(int argc, char* argv[]) {
    int opt = 0;
    //int digit_optind = 0;
    int option_index = 0;
    const char* optstring = "t:h:";
    static struct option long_options[] = {
        { "nsqd_tcp_addr", required_argument, NULL, 't' },
        { "lookupd_http_addr", required_argument, NULL, 'h' },
        { 0, 0, 0, 0 }
    };

    std::string nsqd_tcp_addr;
    std::string lookupd_http_url;

    //nsqd_tcp_addr = "127.0.0.1:4150";
    nsqd_tcp_addr = "10.16.28.17:4150";
    //nsqd_tcp_addr = "weizili-L1:4150";
    //lookupd_http_url = "http://127.0.0.1:4161/lookup?topic=test";
    lookupd_http_url = "http://10.16.28.17:4161/lookup?topic=test";

    while ((opt = getopt_long(argc, argv, optstring, long_options, &option_index)) != -1) {
        switch (opt) {
        case 't':
            nsqd_tcp_addr = optarg;
            break;

        case 'h':
            lookupd_http_url = optarg;
{'fraction_non_alphanumeric': 0.1788793103448276, 'fraction_numerical': 0.034482758620689655, 'mean_word_length': 2.9416135881104033, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 8, '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': '6054722', 'n_tokens_mistral': 1477, 'n_tokens_neox': 1405, 'n_words': 282}