mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-04-19 13:36:54 +02:00
prometheus simpleapi included on mac & linux
This commit is contained in:
parent
e108303cd6
commit
8bc105b527
3 changed files with 15 additions and 2 deletions
|
@ -9,7 +9,7 @@ ifeq ($(origin CXX),default)
|
|||
CXX:=$(shell if [ -e /opt/rh/devtoolset-8/root/usr/bin/g++ ]; then echo /opt/rh/devtoolset-8/root/usr/bin/g++; else echo $(CXX); fi)
|
||||
endif
|
||||
|
||||
INCLUDES?=-Izeroidc/target -isystem ext
|
||||
INCLUDES?=-Izeroidc/target -isystem ext -Iext/prometheus-cpp-lite-1.0/core/include -Iext-prometheus-cpp-lite-1.0/3rdparty/http-client-lite/include -Iext/prometheus-cpp-lite-1.0/simpleapi/include
|
||||
DEFS?=
|
||||
LDLIBS?=
|
||||
DESTDIR?=
|
||||
|
|
|
@ -2,7 +2,7 @@ CC=clang
|
|||
CXX=clang++
|
||||
TOPDIR=$(shell PWD)
|
||||
|
||||
INCLUDES=-I$(shell PWD)/zeroidc/target -isystem $(TOPDIR)/ext
|
||||
INCLUDES=-I$(shell PWD)/zeroidc/target -isystem $(TOPDIR)/ext -I$(TOPDIR)/ext/prometheus-cpp-lite-1.0/core/include -I$(TOPDIR)/ext-prometheus-cpp-lite-1.0/3rdparty/http-client-lite/include -I$(TOPDIR)/ext/prometheus-cpp-lite-1.0/simpleapi/include
|
||||
DEFS=
|
||||
LIBS=
|
||||
ARCH_FLAGS=-arch x86_64 -arch arm64
|
||||
|
|
|
@ -87,6 +87,19 @@
|
|||
#include "../ext/http-parser/http_parser.h"
|
||||
#endif
|
||||
|
||||
#include <prometheus/simpleapi.h>
|
||||
|
||||
namespace prometheus {
|
||||
namespace simpleapi {
|
||||
|
||||
std::shared_ptr<Registry> registry_ptr = std::make_shared<Registry>();
|
||||
Registry& registry = *registry_ptr;
|
||||
SaveToFile saver(registry_ptr, std::chrono::seconds(5), std::string("./metrics.prom"));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if ZT_VAULT_SUPPORT
|
||||
extern "C" {
|
||||
#include <curl/curl.h>
|
||||
|
|
Loading…
Add table
Reference in a new issue