From 60ddca1354a88f510d48f99ee2726c24e29dc543 Mon Sep 17 00:00:00 2001 From: travisladuke Date: Mon, 17 Jul 2023 12:12:18 -0700 Subject: [PATCH] Adjust tcp-proxy makefile to support metrics There's no way to get the metrics yet. Someone will have to add the http service. --- tcp-proxy/Makefile | 4 +++- tcp-proxy/tcp-proxy.cpp | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tcp-proxy/Makefile b/tcp-proxy/Makefile index af4e71e3a..ff77d2b6b 100644 --- a/tcp-proxy/Makefile +++ b/tcp-proxy/Makefile @@ -1,7 +1,9 @@ CXX=$(shell which clang++ g++ c++ 2>/dev/null | head -n 1) +INCLUDES?=-I../ext/prometheus-cpp-lite-1.0/core/include -I../ext/prometheus-cpp-lite-1.0/simpleapi/include + all: - $(CXX) -O3 -fno-rtti -o tcp-proxy tcp-proxy.cpp + $(CXX) -O3 -fno-rtti $(INCLUDES) -std=c++11 -frtti -o tcp-proxy tcp-proxy.cpp ../node/Metrics.cpp clean: rm -f *.o tcp-proxy *.dSYM diff --git a/tcp-proxy/tcp-proxy.cpp b/tcp-proxy/tcp-proxy.cpp index a7d3309f5..b8a753999 100644 --- a/tcp-proxy/tcp-proxy.cpp +++ b/tcp-proxy/tcp-proxy.cpp @@ -42,8 +42,13 @@ #include #define ZT_NO_METRICS 1 + #include "../osdep/Phy.hpp" +#ifndef ZT_NO_METRICS +#include "../node/Metrics.hpp" +#endif + #define ZT_TCP_PROXY_CONNECTION_TIMEOUT_SECONDS 300 #define ZT_TCP_PROXY_TCP_PORT 443