|
|
|
@ -3,6 +3,9 @@
|
|
|
|
|
#include <llarp.h>
|
|
|
|
|
#include <util/fs.hpp>
|
|
|
|
|
#include <util/logger.hpp>
|
|
|
|
|
#include <util/metrics_core.hpp>
|
|
|
|
|
#include <util/metrics_publishers.hpp>
|
|
|
|
|
#include <util/scheduler.hpp>
|
|
|
|
|
|
|
|
|
|
#include <getopt.h>
|
|
|
|
|
#include <signal.h>
|
|
|
|
@ -248,10 +251,24 @@ main(int argc, char *argv[])
|
|
|
|
|
#ifndef _WIN32
|
|
|
|
|
signal(SIGHUP, handle_signal);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
llarp::thread::Scheduler scheduler;
|
|
|
|
|
llarp::metrics::DefaultManagerGuard metricsGuard;
|
|
|
|
|
llarp::metrics::PublisherScheduler publisherScheduler(
|
|
|
|
|
scheduler, metricsGuard.instance());
|
|
|
|
|
metricsGuard.instance()->addGlobalPublisher(
|
|
|
|
|
std::make_shared< llarp::metrics::StreamPublisher >(std::cout));
|
|
|
|
|
|
|
|
|
|
publisherScheduler.setDefault(absl::Seconds(30));
|
|
|
|
|
|
|
|
|
|
scheduler.start();
|
|
|
|
|
|
|
|
|
|
code = llarp_main_setup(ctx);
|
|
|
|
|
if(code == 0)
|
|
|
|
|
code = llarp_main_run(ctx);
|
|
|
|
|
llarp_main_free(ctx);
|
|
|
|
|
|
|
|
|
|
scheduler.stop();
|
|
|
|
|
}
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
::WSACleanup();
|
|
|
|
|