diff --git a/CMakeLists.txt b/CMakeLists.txt index 310d12756..845ead127 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -167,6 +167,7 @@ option(ENABLE_JSON "Enable JSON" ON) option(ENABLE_MONGODB "Enable MongoDB" ON) option(ENABLE_DATA_SQLITE "Enable Data SQlite" ON) option(ENABLE_REDIS "Enable Redis" ON) +option(ENABLE_PROMETHEUS "Enable Prometheus" ON) option(ENABLE_PDF "Enable PDF" OFF) option(ENABLE_UTIL "Enable Util" ON) option(ENABLE_NET "Enable Net" ON) @@ -237,7 +238,7 @@ if(ENABLE_PAGECOMPILER) set(ENABLE_UTIL ON CACHE BOOL "Enable Util" FORCE) endif() -if(ENABLE_MONGODB OR ENABLE_REDIS) +if(ENABLE_MONGODB OR ENABLE_REDIS OR ENABLE_PROMETHEUS) set(ENABLE_NET ON CACHE BOOL "Enable Net" FORCE) endif() @@ -340,6 +341,11 @@ if(EXISTS ${PROJECT_SOURCE_DIR}/Redis AND ENABLE_REDIS) list(APPEND Poco_COMPONENTS "Redis") endif() +if(EXISTS ${PROJECT_SOURCE_DIR}/Prometheus AND ENABLE_PROMETHEUS) + add_subdirectory(Prometheus) + list(APPEND Poco_COMPONENTS "Prometheus") +endif() + if(EXISTS ${PROJECT_SOURCE_DIR}/PDF AND ENABLE_PDF) add_subdirectory(PDF) list(APPEND Poco_COMPONENTS "PDF") diff --git a/Makefile b/Makefile index d5857e3c3..10dc5d5d9 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,7 @@ poco: libexecs $(if $(TESTS),tests) $(if $(SAMPLES),samples) all: libexecs tests samples INSTALLDIR = $(DESTDIR)$(POCO_PREFIX) -COMPONENTS = Foundation Encodings XML JSON Util Net Crypto NetSSL_OpenSSL Data Data/SQLite Data/ODBC Data/MySQL Data/PostgreSQL ActiveRecord ActiveRecord/Compiler Zip PageCompiler PageCompiler/File2Page JWT CppParser PDF MongoDB Redis +COMPONENTS = Foundation Encodings XML JSON Util Net Crypto NetSSL_OpenSSL Data Data/SQLite Data/ODBC Data/MySQL Data/PostgreSQL ActiveRecord ActiveRecord/Compiler Zip PageCompiler PageCompiler/File2Page JWT CppParser PDF MongoDB Redis Prometheus cppunit: $(MAKE) -C $(POCO_BASE)/CppUnit @@ -115,10 +115,10 @@ endif find $(INSTALLDIR)/lib -name "libPoco*" -type f -exec rm -f {} \; find $(INSTALLDIR)/lib -name "libPoco*" -type l -exec rm -f {} \; -libexecs = Foundation-libexec Encodings-libexec XML-libexec JSON-libexec Util-libexec Net-libexec Crypto-libexec NetSSL_OpenSSL-libexec Data-libexec Data/SQLite-libexec Data/ODBC-libexec Data/MySQL-libexec Data/PostgreSQL-libexec ActiveRecord-libexec ActiveRecord/Compiler-libexec Zip-libexec JWT-libexec PageCompiler-libexec PageCompiler/File2Page-libexec CppParser-libexec PDF-libexec MongoDB-libexec Redis-libexec -tests = Foundation-tests Encodings-tests XML-tests JSON-tests Util-tests Net-tests Crypto-tests NetSSL_OpenSSL-tests Data-tests Data/SQLite-tests Data/ODBC-tests Data/MySQL-tests Data/PostgreSQL-tests ActiveRecord-tests JWT-tests Zip-tests CppParser-tests PDF-tests MongoDB-tests Redis-tests +libexecs = Foundation-libexec Encodings-libexec XML-libexec JSON-libexec Util-libexec Net-libexec Crypto-libexec NetSSL_OpenSSL-libexec Data-libexec Data/SQLite-libexec Data/ODBC-libexec Data/MySQL-libexec Data/PostgreSQL-libexec ActiveRecord-libexec ActiveRecord/Compiler-libexec Zip-libexec JWT-libexec PageCompiler-libexec PageCompiler/File2Page-libexec CppParser-libexec PDF-libexec MongoDB-libexec Redis-libexec Prometheus-libexec +tests = Foundation-tests Encodings-tests XML-tests JSON-tests Util-tests Net-tests Crypto-tests NetSSL_OpenSSL-tests Data-tests Data/SQLite-tests Data/ODBC-tests Data/MySQL-tests Data/PostgreSQL-tests ActiveRecord-tests JWT-tests Zip-tests CppParser-tests PDF-tests MongoDB-tests Redis-tests Prometheus-tests samples = Foundation-samples Encodings-samples XML-samples JSON-samples Util-samples Net-samples Crypto-samples NetSSL_OpenSSL-samples Data-samples MongoDB-samples Zip-samples PageCompiler-samples PDF-samples -cleans = Foundation-clean Encodings-clean XML-clean JSON-clean Util-clean Net-clean Crypto-clean NetSSL_OpenSSL-clean Data-clean Data/SQLite-clean Data/ODBC-clean Data/MySQL-clean Data/PostgreSQL-clean ActiveRecord-clean ActiveRecord/Compiler-clean JWT-clean Zip-clean PageCompiler-clean PageCompiler/File2Page-clean CppParser-clean PDF-clean MongoDB-clean Redis-clean +cleans = Foundation-clean Encodings-clean XML-clean JSON-clean Util-clean Net-clean Crypto-clean NetSSL_OpenSSL-clean Data-clean Data/SQLite-clean Data/ODBC-clean Data/MySQL-clean Data/PostgreSQL-clean ActiveRecord-clean ActiveRecord/Compiler-clean JWT-clean Zip-clean PageCompiler-clean PageCompiler/File2Page-clean CppParser-clean PDF-clean MongoDB-clean Redis-clean Prometheus-clean .PHONY: $(libexecs) .PHONY: $(tests) @@ -400,6 +400,20 @@ Redis-clean: $(MAKE) -C $(POCO_BASE)/Redis clean $(MAKE) -C $(POCO_BASE)/Redis/testsuite clean +Prometheus-libexec: Foundation-libexec Net-libexec + $(MAKE) -C $(POCO_BASE)/Prometheus + +Prometheus-tests: Prometheus-libexec cppunit + $(MAKE) -C $(POCO_BASE)/Prometheus/testsuite + +Prometheus-samples: Prometheus-libexec + $(MAKE) -C $(POCO_BASE)/Prometheus/samples + +Prometheus-clean: + $(MAKE) -C $(POCO_BASE)/Prometheus clean + $(MAKE) -C $(POCO_BASE)/Prometheus/testsuite clean + $(MAKE) -C $(POCO_BASE)/Prometheus/samples clean + clean: cleans CppUnit-clean distclean: diff --git a/Prometheus/CMakeLists.txt b/Prometheus/CMakeLists.txt new file mode 100644 index 000000000..f9186f579 --- /dev/null +++ b/Prometheus/CMakeLists.txt @@ -0,0 +1,39 @@ +# Sources +file(GLOB SRCS_G "src/*.cpp") +POCO_SOURCES_AUTO(SRCS ${SRCS_G}) + +# Headers +file(GLOB_RECURSE HDRS_G "include/*.h") +POCO_HEADERS_AUTO(SRCS ${HDRS_G}) + +# Version Resource +if(MSVC AND BUILD_SHARED_LIBS) + source_group("Resources" FILES ${PROJECT_SOURCE_DIR}/DLLVersion.rc) + list(APPEND SRCS ${PROJECT_SOURCE_DIR}/DLLVersion.rc) +endif() + +add_library(Prometheus ${SRCS}) +add_library(Poco::Prometheus ALIAS Prometheus) +set_target_properties(Prometheus + PROPERTIES + VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} + OUTPUT_NAME PocoPrometheus + DEFINE_SYMBOL Prometheus_EXPORTS +) + +target_link_libraries(Prometheus PUBLIC Poco::Net) +target_include_directories(Prometheus + PUBLIC + $ + $ + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src +) + +POCO_INSTALL(Prometheus) +POCO_GENERATE_PACKAGE(Prometheus) + +if(ENABLE_TESTS) + add_subdirectory(samples) + add_subdirectory(testsuite) +endif() + diff --git a/Prometheus/Makefile b/Prometheus/Makefile new file mode 100644 index 000000000..8bd6dd11c --- /dev/null +++ b/Prometheus/Makefile @@ -0,0 +1,28 @@ +# +# Makefile +# +# Makefile for Poco Prometheus +# + +include $(POCO_BASE)/build/rules/global + +objects = \ + Collector \ + Counter \ + IntCounter \ + Gauge \ + IntGauge \ + LabeledMetric \ + Histogram \ + Registry \ + TextExporter \ + MetricsRequestHandler \ + MetricsServer \ + ProcessCollector \ + ThreadPoolCollector + +target = PocoPrometheus +target_version = $(LIBVERSION) +target_libs = PocoFoundation PocoNet + +include $(POCO_BASE)/build/rules/lib diff --git a/Prometheus/Prometheus.progen b/Prometheus/Prometheus.progen new file mode 100644 index 000000000..ee8af33f1 --- /dev/null +++ b/Prometheus/Prometheus.progen @@ -0,0 +1,16 @@ +vc.project.guid = FAB67DE6-17E1-40F5-8FAC-A77A87DA034C +vc.project.name = Prometheus +vc.project.target = Poco${vc.project.name} +vc.project.type = library +vc.project.pocobase = .. +vc.project.outdir = ${vc.project.pocobase} +vc.project.platforms = Win32 +vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md +vc.project.prototype = ${vc.project.name}_vs90.vcproj +vc.project.compiler.include = ..\\Foundation\\include, ..\\Net\\include +vc.project.compiler.defines = +vc.project.compiler.defines.shared = ${vc.project.name}_EXPORTS +vc.project.compiler.defines.debug_shared = ${vc.project.compiler.defines.shared} +vc.project.compiler.defines.release_shared = ${vc.project.compiler.defines.shared} +vc.solution.create = true +vc.solution.include = testsuite\\TestSuite diff --git a/Prometheus/Prometheus_vs140.sln b/Prometheus/Prometheus_vs140.sln new file mode 100644 index 000000000..aa9cdd5a6 --- /dev/null +++ b/Prometheus/Prometheus_vs140.sln @@ -0,0 +1,102 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Prometheus", "Prometheus_vs140.vcxproj", "{FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestSuite", "testsuite\TestSuite_vs140.vcxproj", "{04B69538-1444-4A22-A98D-3C69CD7B44DA}" + ProjectSection(ProjectDependencies) = postProject + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C} = {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + debug_shared|Win32 = debug_shared|Win32 + release_shared|Win32 = release_shared|Win32 + debug_static_mt|Win32 = debug_static_mt|Win32 + release_static_mt|Win32 = release_static_mt|Win32 + debug_static_md|Win32 = debug_static_md|Win32 + release_static_md|Win32 = release_static_md|Win32 + debug_shared|x64 = debug_shared|x64 + release_shared|x64 = release_shared|x64 + debug_static_mt|x64 = debug_static_mt|x64 + release_static_mt|x64 = release_static_mt|x64 + debug_static_md|x64 = debug_static_md|x64 + release_static_md|x64 = release_static_md|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|Win32.ActiveCfg = debug_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|Win32.Build.0 = debug_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|Win32.Deploy.0 = debug_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|Win32.ActiveCfg = release_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|Win32.Build.0 = release_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|Win32.Deploy.0 = release_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|Win32.Build.0 = release_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|Win32.Build.0 = debug_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|Win32.ActiveCfg = release_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|Win32.Build.0 = release_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|Win32.Deploy.0 = release_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|x64.ActiveCfg = debug_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|x64.Build.0 = debug_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|x64.Deploy.0 = debug_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|x64.ActiveCfg = release_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|x64.Build.0 = release_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|x64.Deploy.0 = release_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|x64.Build.0 = debug_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|x64.Deploy.0 = debug_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|x64.ActiveCfg = release_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|x64.Build.0 = release_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|x64.Deploy.0 = release_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|x64.ActiveCfg = debug_static_md|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|x64.Build.0 = debug_static_md|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|x64.Deploy.0 = debug_static_md|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|x64.ActiveCfg = release_static_md|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|x64.Build.0 = release_static_md|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|x64.Deploy.0 = release_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|Win32.ActiveCfg = debug_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|Win32.Build.0 = debug_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|Win32.Deploy.0 = debug_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|Win32.ActiveCfg = release_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|Win32.Build.0 = release_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|Win32.Deploy.0 = release_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|Win32.Build.0 = release_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|Win32.Build.0 = debug_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|Win32.ActiveCfg = release_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|Win32.Build.0 = release_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|Win32.Deploy.0 = release_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|x64.ActiveCfg = debug_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|x64.Build.0 = debug_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|x64.Deploy.0 = debug_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|x64.ActiveCfg = release_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|x64.Build.0 = release_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|x64.Deploy.0 = release_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|x64.Build.0 = debug_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|x64.Deploy.0 = debug_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|x64.ActiveCfg = release_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|x64.Build.0 = release_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|x64.Deploy.0 = release_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|x64.ActiveCfg = debug_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|x64.Build.0 = debug_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|x64.Deploy.0 = debug_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|x64.ActiveCfg = release_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|x64.Build.0 = release_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|x64.Deploy.0 = release_static_md|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Prometheus/Prometheus_vs140.vcxproj b/Prometheus/Prometheus_vs140.vcxproj new file mode 100644 index 000000000..b8c1cec47 --- /dev/null +++ b/Prometheus/Prometheus_vs140.vcxproj @@ -0,0 +1,619 @@ + + + + + debug_shared + Win32 + + + debug_shared + x64 + + + debug_static_md + Win32 + + + debug_static_md + x64 + + + debug_static_mt + Win32 + + + debug_static_mt + x64 + + + release_shared + Win32 + + + release_shared + x64 + + + release_static_md + Win32 + + + release_static_md + x64 + + + release_static_mt + Win32 + + + release_static_mt + x64 + + + + Prometheus + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C} + Prometheus + Win32Proj + + + + StaticLibrary + MultiByte + v140 + + + StaticLibrary + MultiByte + v140 + + + StaticLibrary + MultiByte + v140 + + + StaticLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + StaticLibrary + MultiByte + v140 + + + StaticLibrary + MultiByte + v140 + + + StaticLibrary + MultiByte + v140 + + + StaticLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>14.0.25420.1 + PocoPrometheusd + PocoPrometheusmdd + PocoPrometheusmtd + PocoPrometheus + PocoPrometheusmd + PocoPrometheusmt + PocoPrometheus64d + PocoPrometheusmdd + PocoPrometheusmtd + PocoPrometheus64 + PocoPrometheusmd + PocoPrometheusmt + + + ..\bin\ + obj\Prometheus\$(Configuration)\ + true + + + ..\bin\ + obj\Prometheus\$(Configuration)\ + false + + + ..\lib\ + obj\Prometheus\$(Configuration)\ + + + ..\lib\ + obj\Prometheus\$(Configuration)\ + + + ..\lib\ + obj\Prometheus\$(Configuration)\ + + + ..\lib\ + obj\Prometheus\$(Configuration)\ + + + ..\bin64\ + obj64\Prometheus\$(Configuration)\ + true + + + ..\bin64\ + obj64\Prometheus\$(Configuration)\ + false + + + ..\lib64\ + obj64\Prometheus\$(Configuration)\ + + + ..\lib64\ + obj64\Prometheus\$(Configuration)\ + + + ..\lib64\ + obj64\Prometheus\$(Configuration)\ + + + ..\lib64\ + obj64\Prometheus\$(Configuration)\ + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;Prometheus_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + ..\bin\PocoPrometheusd.dll + true + true + ..\bin\PocoPrometheusd.pdb + ..\lib;%(AdditionalLibraryDirectories) + Console + ..\lib\PocoPrometheusd.lib + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;Prometheus_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + ..\bin\PocoPrometheus.dll + true + false + ..\lib;%(AdditionalLibraryDirectories) + Console + true + true + ..\lib\PocoPrometheus.lib + MachineX86 + + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + ..\lib\PocoPrometheusmtd.pdb + Level3 + ProgramDatabase + Default + true + + + ..\lib\PocoPrometheusmtd.lib + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + ..\lib\PocoPrometheusmt.lib + + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + ..\lib\PocoPrometheusmdd.pdb + Level3 + ProgramDatabase + Default + true + + + ..\lib\PocoPrometheusmdd.lib + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + ..\lib\PocoPrometheusmd.pdb + Level3 + + Default + true + + + ..\lib\PocoPrometheusmd.lib + + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;Prometheus_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + ..\bin64\PocoPrometheus64d.dll + true + true + ..\bin64\PocoPrometheus64d.pdb + ..\lib64;%(AdditionalLibraryDirectories) + Console + ..\lib64\PocoPrometheusd.lib + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;Prometheus_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + ..\bin64\PocoPrometheus64.dll + true + false + ..\lib64;%(AdditionalLibraryDirectories) + Console + true + true + ..\lib64\PocoPrometheus.lib + MachineX64 + + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + ..\lib64\PocoPrometheusmtd.pdb + Level3 + ProgramDatabase + Default + true + + + ..\lib64\PocoPrometheusmtd.lib + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + ..\lib64\PocoPrometheusmt.lib + + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + ..\lib64\PocoPrometheusmdd.pdb + Level3 + ProgramDatabase + Default + true + + + ..\lib64\PocoPrometheusmdd.lib + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + ..\lib64\PocoPrometheusmd.lib + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + + + true + true + true + true + true + true + true + true + + + + + diff --git a/Prometheus/Prometheus_vs140.vcxproj.filters b/Prometheus/Prometheus_vs140.vcxproj.filters new file mode 100644 index 000000000..b8ce683c7 --- /dev/null +++ b/Prometheus/Prometheus_vs140.vcxproj.filters @@ -0,0 +1,117 @@ + + + + + {ed6a131b-f3a8-4f03-91f1-49f5208f73b7} + + + {7c2a7c64-68c6-48c3-9e77-259b1dc511f6} + + + {9fabbf06-bd89-4e78-abd5-e709db2f3318} + + + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + + + + \ No newline at end of file diff --git a/Prometheus/Prometheus_vs150.sln b/Prometheus/Prometheus_vs150.sln new file mode 100644 index 000000000..f6470ac9b --- /dev/null +++ b/Prometheus/Prometheus_vs150.sln @@ -0,0 +1,102 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Prometheus", "Prometheus_vs150.vcxproj", "{FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestSuite", "testsuite\TestSuite_vs150.vcxproj", "{04B69538-1444-4A22-A98D-3C69CD7B44DA}" + ProjectSection(ProjectDependencies) = postProject + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C} = {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + debug_shared|Win32 = debug_shared|Win32 + release_shared|Win32 = release_shared|Win32 + debug_static_mt|Win32 = debug_static_mt|Win32 + release_static_mt|Win32 = release_static_mt|Win32 + debug_static_md|Win32 = debug_static_md|Win32 + release_static_md|Win32 = release_static_md|Win32 + debug_shared|x64 = debug_shared|x64 + release_shared|x64 = release_shared|x64 + debug_static_mt|x64 = debug_static_mt|x64 + release_static_mt|x64 = release_static_mt|x64 + debug_static_md|x64 = debug_static_md|x64 + release_static_md|x64 = release_static_md|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|Win32.ActiveCfg = debug_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|Win32.Build.0 = debug_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|Win32.Deploy.0 = debug_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|Win32.ActiveCfg = release_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|Win32.Build.0 = release_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|Win32.Deploy.0 = release_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|Win32.Build.0 = release_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|Win32.Build.0 = debug_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|Win32.ActiveCfg = release_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|Win32.Build.0 = release_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|Win32.Deploy.0 = release_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|x64.ActiveCfg = debug_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|x64.Build.0 = debug_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|x64.Deploy.0 = debug_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|x64.ActiveCfg = release_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|x64.Build.0 = release_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|x64.Deploy.0 = release_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|x64.Build.0 = debug_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|x64.Deploy.0 = debug_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|x64.ActiveCfg = release_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|x64.Build.0 = release_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|x64.Deploy.0 = release_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|x64.ActiveCfg = debug_static_md|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|x64.Build.0 = debug_static_md|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|x64.Deploy.0 = debug_static_md|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|x64.ActiveCfg = release_static_md|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|x64.Build.0 = release_static_md|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|x64.Deploy.0 = release_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|Win32.ActiveCfg = debug_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|Win32.Build.0 = debug_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|Win32.Deploy.0 = debug_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|Win32.ActiveCfg = release_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|Win32.Build.0 = release_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|Win32.Deploy.0 = release_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|Win32.Build.0 = release_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|Win32.Build.0 = debug_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|Win32.ActiveCfg = release_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|Win32.Build.0 = release_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|Win32.Deploy.0 = release_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|x64.ActiveCfg = debug_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|x64.Build.0 = debug_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|x64.Deploy.0 = debug_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|x64.ActiveCfg = release_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|x64.Build.0 = release_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|x64.Deploy.0 = release_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|x64.Build.0 = debug_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|x64.Deploy.0 = debug_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|x64.ActiveCfg = release_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|x64.Build.0 = release_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|x64.Deploy.0 = release_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|x64.ActiveCfg = debug_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|x64.Build.0 = debug_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|x64.Deploy.0 = debug_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|x64.ActiveCfg = release_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|x64.Build.0 = release_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|x64.Deploy.0 = release_static_md|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Prometheus/Prometheus_vs150.vcxproj b/Prometheus/Prometheus_vs150.vcxproj new file mode 100644 index 000000000..63931976a --- /dev/null +++ b/Prometheus/Prometheus_vs150.vcxproj @@ -0,0 +1,619 @@ + + + + + debug_shared + Win32 + + + debug_shared + x64 + + + debug_static_md + Win32 + + + debug_static_md + x64 + + + debug_static_mt + Win32 + + + debug_static_mt + x64 + + + release_shared + Win32 + + + release_shared + x64 + + + release_static_md + Win32 + + + release_static_md + x64 + + + release_static_mt + Win32 + + + release_static_mt + x64 + + + + Prometheus + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C} + Prometheus + Win32Proj + + + + StaticLibrary + MultiByte + v141 + + + StaticLibrary + MultiByte + v141 + + + StaticLibrary + MultiByte + v141 + + + StaticLibrary + MultiByte + v141 + + + DynamicLibrary + MultiByte + v141 + + + DynamicLibrary + MultiByte + v141 + + + StaticLibrary + MultiByte + v141 + + + StaticLibrary + MultiByte + v141 + + + StaticLibrary + MultiByte + v141 + + + StaticLibrary + MultiByte + v141 + + + DynamicLibrary + MultiByte + v141 + + + DynamicLibrary + MultiByte + v141 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>15.0.28307.799 + PocoPrometheusd + PocoPrometheusmdd + PocoPrometheusmtd + PocoPrometheus + PocoPrometheusmd + PocoPrometheusmt + PocoPrometheus64d + PocoPrometheusmdd + PocoPrometheusmtd + PocoPrometheus64 + PocoPrometheusmd + PocoPrometheusmt + + + ..\bin\ + obj\Prometheus\$(Configuration)\ + true + + + ..\bin\ + obj\Prometheus\$(Configuration)\ + false + + + ..\lib\ + obj\Prometheus\$(Configuration)\ + + + ..\lib\ + obj\Prometheus\$(Configuration)\ + + + ..\lib\ + obj\Prometheus\$(Configuration)\ + + + ..\lib\ + obj\Prometheus\$(Configuration)\ + + + ..\bin64\ + obj64\Prometheus\$(Configuration)\ + true + + + ..\bin64\ + obj64\Prometheus\$(Configuration)\ + false + + + ..\lib64\ + obj64\Prometheus\$(Configuration)\ + + + ..\lib64\ + obj64\Prometheus\$(Configuration)\ + + + ..\lib64\ + obj64\Prometheus\$(Configuration)\ + + + ..\lib64\ + obj64\Prometheus\$(Configuration)\ + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;Prometheus_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + ..\bin\PocoPrometheusd.dll + true + true + ..\bin\PocoPrometheusd.pdb + ..\lib;%(AdditionalLibraryDirectories) + Console + ..\lib\PocoPrometheusd.lib + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;Prometheus_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + ..\bin\PocoPrometheus.dll + true + false + ..\lib;%(AdditionalLibraryDirectories) + Console + true + true + ..\lib\PocoPrometheus.lib + MachineX86 + + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + ..\lib\PocoPrometheusmtd.pdb + Level3 + ProgramDatabase + Default + true + + + ..\lib\PocoPrometheusmtd.lib + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + ..\lib\PocoPrometheusmt.lib + + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + ..\lib\PocoPrometheusmdd.pdb + Level3 + ProgramDatabase + Default + true + + + ..\lib\PocoPrometheusmdd.lib + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + ..\lib\PocoPrometheusmd.pdb + Level3 + + Default + true + + + ..\lib\PocoPrometheusmd.lib + + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;Prometheus_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + ..\bin64\PocoPrometheus64d.dll + true + true + ..\bin64\PocoPrometheus64d.pdb + ..\lib64;%(AdditionalLibraryDirectories) + Console + ..\lib64\PocoPrometheusd.lib + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;Prometheus_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + ..\bin64\PocoPrometheus64.dll + true + false + ..\lib64;%(AdditionalLibraryDirectories) + Console + true + true + ..\lib64\PocoPrometheus.lib + MachineX64 + + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + ..\lib64\PocoPrometheusmtd.pdb + Level3 + ProgramDatabase + Default + true + + + ..\lib64\PocoPrometheusmtd.lib + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + ..\lib64\PocoPrometheusmt.lib + + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + ..\lib64\PocoPrometheusmdd.pdb + Level3 + ProgramDatabase + Default + true + + + ..\lib64\PocoPrometheusmdd.lib + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + ..\lib64\PocoPrometheusmd.lib + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + + + true + true + true + true + true + true + true + true + + + + + diff --git a/Prometheus/Prometheus_vs150.vcxproj.filters b/Prometheus/Prometheus_vs150.vcxproj.filters new file mode 100644 index 000000000..de9a3a90e --- /dev/null +++ b/Prometheus/Prometheus_vs150.vcxproj.filters @@ -0,0 +1,117 @@ + + + + + {240326af-19f6-4bd8-9f0c-379d8843a11a} + + + {259f15f5-0be6-4ddb-ace2-eca7f7ffff2f} + + + {97714498-6e40-4ef5-89a1-1c24d1b0b836} + + + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + + + + \ No newline at end of file diff --git a/Prometheus/Prometheus_vs160.sln b/Prometheus/Prometheus_vs160.sln new file mode 100644 index 000000000..646bf4a3c --- /dev/null +++ b/Prometheus/Prometheus_vs160.sln @@ -0,0 +1,102 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Prometheus", "Prometheus_vs160.vcxproj", "{FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestSuite", "testsuite\TestSuite_vs160.vcxproj", "{04B69538-1444-4A22-A98D-3C69CD7B44DA}" + ProjectSection(ProjectDependencies) = postProject + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C} = {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + debug_shared|Win32 = debug_shared|Win32 + release_shared|Win32 = release_shared|Win32 + debug_static_mt|Win32 = debug_static_mt|Win32 + release_static_mt|Win32 = release_static_mt|Win32 + debug_static_md|Win32 = debug_static_md|Win32 + release_static_md|Win32 = release_static_md|Win32 + debug_shared|x64 = debug_shared|x64 + release_shared|x64 = release_shared|x64 + debug_static_mt|x64 = debug_static_mt|x64 + release_static_mt|x64 = release_static_mt|x64 + debug_static_md|x64 = debug_static_md|x64 + release_static_md|x64 = release_static_md|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|Win32.ActiveCfg = debug_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|Win32.Build.0 = debug_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|Win32.Deploy.0 = debug_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|Win32.ActiveCfg = release_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|Win32.Build.0 = release_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|Win32.Deploy.0 = release_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|Win32.Build.0 = release_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|Win32.Build.0 = debug_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|Win32.ActiveCfg = release_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|Win32.Build.0 = release_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|Win32.Deploy.0 = release_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|x64.ActiveCfg = debug_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|x64.Build.0 = debug_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|x64.Deploy.0 = debug_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|x64.ActiveCfg = release_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|x64.Build.0 = release_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|x64.Deploy.0 = release_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|x64.Build.0 = debug_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|x64.Deploy.0 = debug_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|x64.ActiveCfg = release_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|x64.Build.0 = release_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|x64.Deploy.0 = release_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|x64.ActiveCfg = debug_static_md|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|x64.Build.0 = debug_static_md|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|x64.Deploy.0 = debug_static_md|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|x64.ActiveCfg = release_static_md|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|x64.Build.0 = release_static_md|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|x64.Deploy.0 = release_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|Win32.ActiveCfg = debug_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|Win32.Build.0 = debug_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|Win32.Deploy.0 = debug_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|Win32.ActiveCfg = release_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|Win32.Build.0 = release_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|Win32.Deploy.0 = release_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|Win32.Build.0 = release_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|Win32.Build.0 = debug_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|Win32.ActiveCfg = release_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|Win32.Build.0 = release_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|Win32.Deploy.0 = release_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|x64.ActiveCfg = debug_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|x64.Build.0 = debug_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|x64.Deploy.0 = debug_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|x64.ActiveCfg = release_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|x64.Build.0 = release_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|x64.Deploy.0 = release_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|x64.Build.0 = debug_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|x64.Deploy.0 = debug_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|x64.ActiveCfg = release_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|x64.Build.0 = release_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|x64.Deploy.0 = release_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|x64.ActiveCfg = debug_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|x64.Build.0 = debug_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|x64.Deploy.0 = debug_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|x64.ActiveCfg = release_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|x64.Build.0 = release_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|x64.Deploy.0 = release_static_md|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Prometheus/Prometheus_vs160.vcxproj b/Prometheus/Prometheus_vs160.vcxproj new file mode 100644 index 000000000..a88388570 --- /dev/null +++ b/Prometheus/Prometheus_vs160.vcxproj @@ -0,0 +1,619 @@ + + + + + debug_shared + Win32 + + + debug_shared + x64 + + + debug_static_md + Win32 + + + debug_static_md + x64 + + + debug_static_mt + Win32 + + + debug_static_mt + x64 + + + release_shared + Win32 + + + release_shared + x64 + + + release_static_md + Win32 + + + release_static_md + x64 + + + release_static_mt + Win32 + + + release_static_mt + x64 + + + + Prometheus + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C} + Prometheus + Win32Proj + + + + StaticLibrary + MultiByte + v142 + + + StaticLibrary + MultiByte + v142 + + + StaticLibrary + MultiByte + v142 + + + StaticLibrary + MultiByte + v142 + + + DynamicLibrary + MultiByte + v142 + + + DynamicLibrary + MultiByte + v142 + + + StaticLibrary + MultiByte + v142 + + + StaticLibrary + MultiByte + v142 + + + StaticLibrary + MultiByte + v142 + + + StaticLibrary + MultiByte + v142 + + + DynamicLibrary + MultiByte + v142 + + + DynamicLibrary + MultiByte + v142 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>15.0.28307.799 + PocoPrometheusd + PocoPrometheusmdd + PocoPrometheusmtd + PocoPrometheus + PocoPrometheusmd + PocoPrometheusmt + PocoPrometheus64d + PocoPrometheusmdd + PocoPrometheusmtd + PocoPrometheus64 + PocoPrometheusmd + PocoPrometheusmt + + + ..\bin\ + obj\Prometheus\$(Configuration)\ + true + + + ..\bin\ + obj\Prometheus\$(Configuration)\ + false + + + ..\lib\ + obj\Prometheus\$(Configuration)\ + + + ..\lib\ + obj\Prometheus\$(Configuration)\ + + + ..\lib\ + obj\Prometheus\$(Configuration)\ + + + ..\lib\ + obj\Prometheus\$(Configuration)\ + + + ..\bin64\ + obj64\Prometheus\$(Configuration)\ + true + + + ..\bin64\ + obj64\Prometheus\$(Configuration)\ + false + + + ..\lib64\ + obj64\Prometheus\$(Configuration)\ + + + ..\lib64\ + obj64\Prometheus\$(Configuration)\ + + + ..\lib64\ + obj64\Prometheus\$(Configuration)\ + + + ..\lib64\ + obj64\Prometheus\$(Configuration)\ + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;Prometheus_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + ..\bin\PocoPrometheusd.dll + true + true + ..\bin\PocoPrometheusd.pdb + ..\lib;%(AdditionalLibraryDirectories) + Console + ..\lib\PocoPrometheusd.lib + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;Prometheus_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + ..\bin\PocoPrometheus.dll + true + false + ..\lib;%(AdditionalLibraryDirectories) + Console + true + true + ..\lib\PocoPrometheus.lib + MachineX86 + + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + ..\lib\PocoPrometheusmtd.pdb + Level3 + ProgramDatabase + Default + true + + + ..\lib\PocoPrometheusmtd.lib + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + ..\lib\PocoPrometheusmt.lib + + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + ..\lib\PocoPrometheusmdd.pdb + Level3 + ProgramDatabase + Default + true + + + ..\lib\PocoPrometheusmdd.lib + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + ..\lib\PocoPrometheusmd.pdb + Level3 + + Default + true + + + ..\lib\PocoPrometheusmd.lib + + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;Prometheus_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + ..\bin64\PocoPrometheus64d.dll + true + true + ..\bin64\PocoPrometheus64d.pdb + ..\lib64;%(AdditionalLibraryDirectories) + Console + ..\lib64\PocoPrometheusd.lib + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;Prometheus_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + ..\bin64\PocoPrometheus64.dll + true + false + ..\lib64;%(AdditionalLibraryDirectories) + Console + true + true + ..\lib64\PocoPrometheus.lib + MachineX64 + + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + ..\lib64\PocoPrometheusmtd.pdb + Level3 + ProgramDatabase + Default + true + + + ..\lib64\PocoPrometheusmtd.lib + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + ..\lib64\PocoPrometheusmt.lib + + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + ..\lib64\PocoPrometheusmdd.pdb + Level3 + ProgramDatabase + Default + true + + + ..\lib64\PocoPrometheusmdd.lib + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + ..\lib64\PocoPrometheusmd.lib + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + + + true + true + true + true + true + true + true + true + + + + + diff --git a/Prometheus/Prometheus_vs160.vcxproj.filters b/Prometheus/Prometheus_vs160.vcxproj.filters new file mode 100644 index 000000000..686f883fe --- /dev/null +++ b/Prometheus/Prometheus_vs160.vcxproj.filters @@ -0,0 +1,117 @@ + + + + + {da550d87-d4ce-43f1-9de7-95ff18bd3b61} + + + {b856d548-6ff2-43b8-8ece-28beb7105da2} + + + {00c34b95-ed74-4de6-846c-f93021b9ea5f} + + + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + + + + \ No newline at end of file diff --git a/Prometheus/Prometheus_vs170.sln b/Prometheus/Prometheus_vs170.sln new file mode 100644 index 000000000..1e942dc74 --- /dev/null +++ b/Prometheus/Prometheus_vs170.sln @@ -0,0 +1,102 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Prometheus", "Prometheus_vs170.vcxproj", "{FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestSuite", "testsuite\TestSuite_vs170.vcxproj", "{04B69538-1444-4A22-A98D-3C69CD7B44DA}" + ProjectSection(ProjectDependencies) = postProject + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C} = {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + debug_shared|Win32 = debug_shared|Win32 + release_shared|Win32 = release_shared|Win32 + debug_static_mt|Win32 = debug_static_mt|Win32 + release_static_mt|Win32 = release_static_mt|Win32 + debug_static_md|Win32 = debug_static_md|Win32 + release_static_md|Win32 = release_static_md|Win32 + debug_shared|x64 = debug_shared|x64 + release_shared|x64 = release_shared|x64 + debug_static_mt|x64 = debug_static_mt|x64 + release_static_mt|x64 = release_static_mt|x64 + debug_static_md|x64 = debug_static_md|x64 + release_static_md|x64 = release_static_md|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|Win32.ActiveCfg = debug_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|Win32.Build.0 = debug_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|Win32.Deploy.0 = debug_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|Win32.ActiveCfg = release_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|Win32.Build.0 = release_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|Win32.Deploy.0 = release_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|Win32.Build.0 = release_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|Win32.Build.0 = debug_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|Win32.ActiveCfg = release_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|Win32.Build.0 = release_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|Win32.Deploy.0 = release_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|x64.ActiveCfg = debug_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|x64.Build.0 = debug_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|x64.Deploy.0 = debug_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|x64.ActiveCfg = release_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|x64.Build.0 = release_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|x64.Deploy.0 = release_shared|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|x64.Build.0 = debug_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|x64.Deploy.0 = debug_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|x64.ActiveCfg = release_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|x64.Build.0 = release_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|x64.Deploy.0 = release_static_mt|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|x64.ActiveCfg = debug_static_md|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|x64.Build.0 = debug_static_md|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|x64.Deploy.0 = debug_static_md|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|x64.ActiveCfg = release_static_md|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|x64.Build.0 = release_static_md|x64 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|x64.Deploy.0 = release_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|Win32.ActiveCfg = debug_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|Win32.Build.0 = debug_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|Win32.Deploy.0 = debug_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|Win32.ActiveCfg = release_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|Win32.Build.0 = release_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|Win32.Deploy.0 = release_shared|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|Win32.Build.0 = release_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|Win32.Build.0 = debug_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|Win32.ActiveCfg = release_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|Win32.Build.0 = release_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|Win32.Deploy.0 = release_static_md|Win32 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|x64.ActiveCfg = debug_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|x64.Build.0 = debug_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_shared|x64.Deploy.0 = debug_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|x64.ActiveCfg = release_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|x64.Build.0 = release_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_shared|x64.Deploy.0 = release_shared|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|x64.Build.0 = debug_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_mt|x64.Deploy.0 = debug_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|x64.ActiveCfg = release_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|x64.Build.0 = release_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_mt|x64.Deploy.0 = release_static_mt|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|x64.ActiveCfg = debug_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|x64.Build.0 = debug_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.debug_static_md|x64.Deploy.0 = debug_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|x64.ActiveCfg = release_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|x64.Build.0 = release_static_md|x64 + {04B69538-1444-4A22-A98D-3C69CD7B44DA}.release_static_md|x64.Deploy.0 = release_static_md|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Prometheus/Prometheus_vs170.vcxproj b/Prometheus/Prometheus_vs170.vcxproj new file mode 100644 index 000000000..a0a23affe --- /dev/null +++ b/Prometheus/Prometheus_vs170.vcxproj @@ -0,0 +1,619 @@ + + + + + debug_shared + Win32 + + + debug_shared + x64 + + + debug_static_md + Win32 + + + debug_static_md + x64 + + + debug_static_mt + Win32 + + + debug_static_mt + x64 + + + release_shared + Win32 + + + release_shared + x64 + + + release_static_md + Win32 + + + release_static_md + x64 + + + release_static_mt + Win32 + + + release_static_mt + x64 + + + + Prometheus + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C} + Prometheus + Win32Proj + + + + StaticLibrary + MultiByte + v143 + + + StaticLibrary + MultiByte + v143 + + + StaticLibrary + MultiByte + v143 + + + StaticLibrary + MultiByte + v143 + + + DynamicLibrary + MultiByte + v143 + + + DynamicLibrary + MultiByte + v143 + + + StaticLibrary + MultiByte + v143 + + + StaticLibrary + MultiByte + v143 + + + StaticLibrary + MultiByte + v143 + + + StaticLibrary + MultiByte + v143 + + + DynamicLibrary + MultiByte + v143 + + + DynamicLibrary + MultiByte + v143 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>15.0.28307.799 + PocoPrometheusd + PocoPrometheusmdd + PocoPrometheusmtd + PocoPrometheus + PocoPrometheusmd + PocoPrometheusmt + PocoPrometheus64d + PocoPrometheusmdd + PocoPrometheusmtd + PocoPrometheus64 + PocoPrometheusmd + PocoPrometheusmt + + + ..\bin\ + obj\Prometheus\$(Configuration)\ + true + + + ..\bin\ + obj\Prometheus\$(Configuration)\ + false + + + ..\lib\ + obj\Prometheus\$(Configuration)\ + + + ..\lib\ + obj\Prometheus\$(Configuration)\ + + + ..\lib\ + obj\Prometheus\$(Configuration)\ + + + ..\lib\ + obj\Prometheus\$(Configuration)\ + + + ..\bin64\ + obj64\Prometheus\$(Configuration)\ + true + + + ..\bin64\ + obj64\Prometheus\$(Configuration)\ + false + + + ..\lib64\ + obj64\Prometheus\$(Configuration)\ + + + ..\lib64\ + obj64\Prometheus\$(Configuration)\ + + + ..\lib64\ + obj64\Prometheus\$(Configuration)\ + + + ..\lib64\ + obj64\Prometheus\$(Configuration)\ + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;Prometheus_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + ..\bin\PocoPrometheusd.dll + true + true + ..\bin\PocoPrometheusd.pdb + ..\lib;%(AdditionalLibraryDirectories) + Console + ..\lib\PocoPrometheusd.lib + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;Prometheus_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + ..\bin\PocoPrometheus.dll + true + false + ..\lib;%(AdditionalLibraryDirectories) + Console + true + true + ..\lib\PocoPrometheus.lib + MachineX86 + + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + ..\lib\PocoPrometheusmtd.pdb + Level3 + ProgramDatabase + Default + true + + + ..\lib\PocoPrometheusmtd.lib + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + ..\lib\PocoPrometheusmt.lib + + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + ..\lib\PocoPrometheusmdd.pdb + Level3 + ProgramDatabase + Default + true + + + ..\lib\PocoPrometheusmdd.lib + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + ..\lib\PocoPrometheusmd.pdb + Level3 + + Default + true + + + ..\lib\PocoPrometheusmd.lib + + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;Prometheus_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + ..\bin64\PocoPrometheus64d.dll + true + true + ..\bin64\PocoPrometheus64d.pdb + ..\lib64;%(AdditionalLibraryDirectories) + Console + ..\lib64\PocoPrometheusd.lib + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;Prometheus_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + ..\bin64\PocoPrometheus64.dll + true + false + ..\lib64;%(AdditionalLibraryDirectories) + Console + true + true + ..\lib64\PocoPrometheus.lib + MachineX64 + + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + ..\lib64\PocoPrometheusmtd.pdb + Level3 + ProgramDatabase + Default + true + + + ..\lib64\PocoPrometheusmtd.lib + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + ..\lib64\PocoPrometheusmt.lib + + + + + Disabled + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + ..\lib64\PocoPrometheusmdd.pdb + Level3 + ProgramDatabase + Default + true + + + ..\lib64\PocoPrometheusmdd.lib + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\Foundation\include; ..\Net\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + ..\lib64\PocoPrometheusmd.lib + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + + + true + true + true + true + true + true + true + true + + + + + diff --git a/Prometheus/Prometheus_vs170.vcxproj.filters b/Prometheus/Prometheus_vs170.vcxproj.filters new file mode 100644 index 000000000..2548d3690 --- /dev/null +++ b/Prometheus/Prometheus_vs170.vcxproj.filters @@ -0,0 +1,117 @@ + + + + + {d9fa76ba-4879-42fe-b58d-5e9b5ea0e30e} + + + {3de05224-2bb9-4fb1-84ba-df073562fa5f} + + + {b4aec395-e181-43e0-97f0-269d20432b09} + + + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + Prometheus\Header Files + + + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + Prometheus\Source Files + + + + + + \ No newline at end of file diff --git a/Prometheus/Prometheus_vs90.sln b/Prometheus/Prometheus_vs90.sln new file mode 100644 index 000000000..3760663e0 --- /dev/null +++ b/Prometheus/Prometheus_vs90.sln @@ -0,0 +1,60 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Prometheus", "Prometheus_vs90.vcproj", "{FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestSuite", "testsuite\TestSuite_vs90.vcproj", "{16B8C4E7-6F29-4910-9350-848730F9EF77}" + ProjectSection(ProjectDependencies) = postProject + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C} = {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + debug_shared|Win32 = debug_shared|Win32 + debug_static_md|Win32 = debug_static_md|Win32 + debug_static_mt|Win32 = debug_static_mt|Win32 + release_shared|Win32 = release_shared|Win32 + release_static_md|Win32 = release_static_md|Win32 + release_static_mt|Win32 = release_static_mt|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|Win32.ActiveCfg = debug_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|Win32.Build.0 = debug_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_shared|Win32.Deploy.0 = debug_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|Win32.Build.0 = debug_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|Win32.ActiveCfg = release_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|Win32.Build.0 = release_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_shared|Win32.Deploy.0 = release_shared|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|Win32.ActiveCfg = release_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|Win32.Build.0 = release_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_md|Win32.Deploy.0 = release_static_md|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|Win32.Build.0 = release_static_mt|Win32 + {FAB67DE6-17E1-40F5-8FAC-A77A87DA034C}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32 + {16B8C4E7-6F29-4910-9350-848730F9EF77}.debug_shared|Win32.ActiveCfg = debug_shared|Win32 + {16B8C4E7-6F29-4910-9350-848730F9EF77}.debug_shared|Win32.Build.0 = debug_shared|Win32 + {16B8C4E7-6F29-4910-9350-848730F9EF77}.debug_shared|Win32.Deploy.0 = debug_shared|Win32 + {16B8C4E7-6F29-4910-9350-848730F9EF77}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32 + {16B8C4E7-6F29-4910-9350-848730F9EF77}.debug_static_md|Win32.Build.0 = debug_static_md|Win32 + {16B8C4E7-6F29-4910-9350-848730F9EF77}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32 + {16B8C4E7-6F29-4910-9350-848730F9EF77}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32 + {16B8C4E7-6F29-4910-9350-848730F9EF77}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32 + {16B8C4E7-6F29-4910-9350-848730F9EF77}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32 + {16B8C4E7-6F29-4910-9350-848730F9EF77}.release_shared|Win32.ActiveCfg = release_shared|Win32 + {16B8C4E7-6F29-4910-9350-848730F9EF77}.release_shared|Win32.Build.0 = release_shared|Win32 + {16B8C4E7-6F29-4910-9350-848730F9EF77}.release_shared|Win32.Deploy.0 = release_shared|Win32 + {16B8C4E7-6F29-4910-9350-848730F9EF77}.release_static_md|Win32.ActiveCfg = release_static_md|Win32 + {16B8C4E7-6F29-4910-9350-848730F9EF77}.release_static_md|Win32.Build.0 = release_static_md|Win32 + {16B8C4E7-6F29-4910-9350-848730F9EF77}.release_static_md|Win32.Deploy.0 = release_static_md|Win32 + {16B8C4E7-6F29-4910-9350-848730F9EF77}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32 + {16B8C4E7-6F29-4910-9350-848730F9EF77}.release_static_mt|Win32.Build.0 = release_static_mt|Win32 + {16B8C4E7-6F29-4910-9350-848730F9EF77}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Prometheus/Prometheus_vs90.vcproj b/Prometheus/Prometheus_vs90.vcproj new file mode 100644 index 000000000..a1162ddb5 --- /dev/null +++ b/Prometheus/Prometheus_vs90.vcproj @@ -0,0 +1,676 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Prometheus/cmake/PocoPrometheusConfig.cmake b/Prometheus/cmake/PocoPrometheusConfig.cmake new file mode 100644 index 000000000..207f8c045 --- /dev/null +++ b/Prometheus/cmake/PocoPrometheusConfig.cmake @@ -0,0 +1,4 @@ +include(CMakeFindDependencyMacro) +find_dependency(PocoFoundation) +find_dependency(PocoNet) +include("${CMAKE_CURRENT_LIST_DIR}/PocoPrometheusTargets.cmake") diff --git a/Prometheus/dependencies b/Prometheus/dependencies new file mode 100644 index 000000000..f6d54af82 --- /dev/null +++ b/Prometheus/dependencies @@ -0,0 +1,2 @@ +Foundation +Net diff --git a/Prometheus/include/Poco/Prometheus/AtomicFloat.h b/Prometheus/include/Poco/Prometheus/AtomicFloat.h new file mode 100644 index 000000000..4e8f9f85f --- /dev/null +++ b/Prometheus/include/Poco/Prometheus/AtomicFloat.h @@ -0,0 +1,105 @@ +// +// AtomicFloat.h +// +// Library: Prometheus +// Package: Core +// Module: AtomicFloat +// +// Definition of the AtomicFloat class template. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Prometheus_AtomicFloat_INCLUDED +#define Prometheus_AtomicFloat_INCLUDED + + +#include + + +namespace Poco { +namespace Prometheus { + + +template +class AtomicFloat + /// This class provides efficient atomic operations + /// on float and double values. +{ +public: + AtomicFloat(): + _value{0} + { + } + + explicit AtomicFloat(T v): + _value(v) + { + } + + AtomicFloat(const AtomicFloat& v): + _value(v.value()) + { + } + + AtomicFloat& operator = (const AtomicFloat& v) + { + _value.store(v.value()); + return *this; + } + + AtomicFloat& operator = (T v) + { + _value.store(v); + return *this; + } + + operator T () const + { + return _value.load(); + } + + T value() const + { + return _value.load(); + } + + AtomicFloat& operator += (T value) + { + T expected = _value.load(); + T desired; + do + { + desired = expected + value; + } + while (!_value.compare_exchange_weak(expected, desired)); + + return *this; + } + + AtomicFloat& operator -= (T value) + { + T expected = _value.load(); + T desired; + do + { + desired = expected - value; + } + while (!_value.compare_exchange_weak(expected, desired)); + + return *this; + } + +private: + std::atomic _value; +}; + + +} } // namespace Poco::Prometheus + + +#endif // Prometheus_AtomicFloat_INCLUDED diff --git a/Prometheus/include/Poco/Prometheus/CallbackMetric.h b/Prometheus/include/Poco/Prometheus/CallbackMetric.h new file mode 100644 index 000000000..c2b6a5a94 --- /dev/null +++ b/Prometheus/include/Poco/Prometheus/CallbackMetric.h @@ -0,0 +1,151 @@ +// +// CallbackMetric.h +// +// Library: Prometheus +// Package: Core +// Module: CallbackMetric +// +// Definition of the CallbackMetric class template. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Prometheus_CallbackMetric_INCLUDED +#define Prometheus_CallbackMetric_INCLUDED + + +#include "Poco/Prometheus/Metric.h" +#include "Poco/Prometheus/Exporter.h" +#include +#include + + +namespace Poco { +namespace Prometheus { + + +template +class CallbackMetric: public Metric + /// A generic Metric implementation where the sample is + /// obtained via a callback function or lambda. + /// + /// The callback is invoked whenever the value + /// of the metric is requested. This is typically when + /// the metric is written to an Exporter. + /// + /// This is implemented as a template to support both counter and gauge + /// metrics with different underlying types. + /// + /// Note that only metric types COUNTER and GAUGE are supported. + /// + /// Labels are not supported. + /// + /// Example usage: + /// CallbackMetric sampleCount( + /// "sample_count"s, + /// []() + /// { + /// return 42; + /// } + /// ); + /// + /// There are also pre-instantiated types available: + /// - CallbackIntCounter + /// - CallbackIntGauge + /// - CallbackCounter + /// - CallbackGauge + /// + /// The following sample types are supported: + /// - Poco::Int32 + /// - Poco::UInt32 + /// - Poco::Int64 + /// - Poco::UInt64 + /// - double +{ +public: + using Sample = T; + using Callback = std::function; + + CallbackMetric(const std::string& name, Callback callback): + Metric(metricType, name), + _callback(callback) + /// Creates a CallbackMetric with the given type and name and + /// registers it with the default registry. + { + } + + CallbackMetric(const std::string& name, const std::string& help, Callback callback): + Metric(metricType, name), + _callback(callback) + /// Creates a CallbackMetric with the given type, name and help text, and + /// registers it with the default registry. + { + setHelp(help); + } + + CallbackMetric(const std::string& name, Registry* pRegistry, Callback callback): + Metric(metricType, name, pRegistry), + _callback(callback) + /// Creates a CallbackMetric with the given type and name and + /// registers it with the given registry (if not nullptr). + { + } + + CallbackMetric(const std::string& name, const std::string& help, Registry* pRegistry, Callback callback): + Metric(metricType, name, pRegistry), + _callback(callback) + /// Creates a CallbackMetric with the given type, name and help text, and + /// registers it with the given registry (if not nullptr). + { + setHelp(help); + } + + ~CallbackMetric() = default; + /// Destroys the CallbackMetric. + + using Metric::help; + CallbackMetric& help(const std::string& text) + /// Sets the CallbackMetric's help text. + /// + /// Must only be set once, immediately after creating + /// the CallbackMetric. + { + setHelp(text); + return *this; + } + + Sample value() const + /// Invokes the callback function and returns the + /// value returned by it. + { + return _callback(); + } + + // Collector + void exportTo(Exporter& exporter) const override + { + const std::vector EMPTY_VEC; + + exporter.writeHeader(*this); + exporter.writeSample(*this, EMPTY_VEC, EMPTY_VEC, _callback(), 0); + } + +private: + Callback _callback; +}; + + +using CallbackIntCounter = CallbackMetric; +using CallbackIntGauge = CallbackMetric; +using CallbackCounter = CallbackMetric; +using CallbackGauge = CallbackMetric; + + +} } // namespace Poco::Prometheus + + +#endif // Prometheus_CallbackMetric_INCLUDED diff --git a/Prometheus/include/Poco/Prometheus/Collector.h b/Prometheus/include/Poco/Prometheus/Collector.h new file mode 100644 index 000000000..f78dfb909 --- /dev/null +++ b/Prometheus/include/Poco/Prometheus/Collector.h @@ -0,0 +1,114 @@ +// +// Collector.h +// +// Library: Prometheus +// Package: Core +// Module: Collector +// +// Definition of the Collector class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Prometheus_Collector_INCLUDED +#define Prometheus_Collector_INCLUDED + + +#include "Poco/Prometheus/Prometheus.h" +#include "Poco/Prometheus/Registry.h" + + +namespace Poco { +namespace Prometheus { + + +class Exporter; +class Registry; + + +class Prometheus_API Collector + /// This is the base class for all metrics, such as + /// Counter, Gauge and Histogram. + /// + /// Collector objects automatically register themselves + /// with the default Registry (unless a nullptr is passed to the + /// constructor's pRegistry parameter), but do not automatically + /// unregister. This brings the danger of dangling pointers if + /// Collector instances are destroyed without being explicitly + /// unregistered first. In most practical cases this is not an + /// issue as Collector instances will be alive for the entire + /// run time of the process. However, it can be an issue if + /// Collector instances are created and destroyed dynamically + /// during the run time of the process. +{ +public: + const std::string& name() const; + /// Returns the metric's name. + + virtual void exportTo(Exporter& exporter) const = 0; + /// Writes the given Metric to the Exporter. + + virtual ~Collector() = default; + /// Destroys the Collector. + +protected: + Collector(const std::string& name); + /// Creates a Collector with the given name + /// and registers it with the default Registry. + /// + /// The name must be a valid metric name and match the regular + /// expression [a-zA-Z_:][a-zA-Z0-9_:]*. + + Collector(const std::string& name, Registry* pRegistry); + /// Creates a Collector with the given name + /// and registers it with the given Registry (if not nullptr). + /// + /// The name must be a valid metric name and match the regular + /// expression [a-zA-Z_:][a-zA-Z0-9_:]*. + + static const std::string& validateName(const std::string& name); + +private: + const std::string _name; + + Collector() = delete; + Collector(const Collector&) = delete; + Collector(Collector&&) = delete; + Collector& operator = (const Collector&) = delete; + Collector& operator = (Collector&&) = delete; +}; + + +// +// inlines +// + + +inline Collector::Collector(const std::string& name): + _name(validateName(name)) +{ + Registry::defaultRegistry().registerCollector(this); +} + + +inline Collector::Collector(const std::string& name, Registry* pRegistry): + _name(validateName(name)) +{ + if (pRegistry) pRegistry->registerCollector(this); +} + + +inline const std::string& Collector::name() const +{ + return _name; +} + + +} } // namespace Poco::Prometheus + + +#endif // Prometheus_Collector_INCLUDED diff --git a/Prometheus/include/Poco/Prometheus/Counter.h b/Prometheus/include/Poco/Prometheus/Counter.h new file mode 100644 index 000000000..d24f2c1ab --- /dev/null +++ b/Prometheus/include/Poco/Prometheus/Counter.h @@ -0,0 +1,191 @@ +// +// Counter.h +// +// Library: Prometheus +// Package: Core +// Module: Counter +// +// Definition of the Counter class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Prometheus_Counter_INCLUDED +#define Prometheus_Counter_INCLUDED + + +#include "Poco/Prometheus/LabeledMetricImpl.h" +#include "Poco/Prometheus/AtomicFloat.h" +#include "Poco/Mutex.h" + + +namespace Poco { +namespace Prometheus { + + +class Prometheus_API CounterSample +{ +public: + CounterSample() = default; + /// Creates the CounterSample. + + ~CounterSample() = default; + /// Destroys the CounterSample. + + double value() const; + /// Returns the counter's current value. + + Poco::Timestamp timestamp() const; + /// Returns the sample's timestamp, which in this + /// implementation is always 0. + + void inc(double v = 1.0); + /// Increments the counter's current value. + +private: + AtomicFloat _value; + + CounterSample(const CounterSample&) = delete; + CounterSample(CounterSample&&) = delete; + CounterSample& operator = (const CounterSample&) = delete; + CounterSample& operator = (CounterSample&&) = delete; +}; + + +class Prometheus_API Counter: public LabeledMetricImpl + /// A generic counter supporting labels. + /// + /// To create a Counter with labels and register it + /// with the default Registry: + /// Counter sampleCounter("sample_counter"s, { + /// .help = "A sample counter"s, + /// .labelNames = {"label1"s, "label2"s} + /// }); + /// + /// To increment a Counter (with labels): + /// sampleCounter.labels({"value1"s, "value2"}).inc(); + /// + /// To create a Counter without labels and register it + /// with the default Registry: + /// Counter simpleCounter("simple_counter"s); + /// simpleCounter.help("A simple counter"s); + /// + /// To increment the value of a Counter (without labels): + /// simpleCounter.inc(42); +{ +public: + struct Params + { + std::string help; + std::vector labelNames; + }; + + explicit Counter(const std::string& name); + /// Creates a Counter with the given name and + /// registers it with the default registry. + + Counter(const std::string& name, const Params& params); + /// Creates a Counter with the given name and parameters + /// registers it with the default registry. + + Counter(const std::string& name, Registry* pRegistry); + /// Creates a Counter with the given name and + /// registers it with the given registry (if not nullptr). + + Counter(const std::string& name, const Params& params, Registry* pRegistry); + /// Creates a Counter with the given name and params, and + /// registers it with the given registry (if not nullptr). + + ~Counter() = default; + /// Destroys the Counter. + + using LabeledMetric::help; + Counter& help(const std::string& text); + /// Sets the Counter's help text. + /// + /// Must only be set once, immediately after creating + /// the Counter. + + using LabeledMetric::labelNames; + Counter& labelNames(const std::vector& labelNames); + /// Sets the Counter's label names. + /// + /// Must only be set once, immediately after creating + /// the Counter. + + double value() const; + /// Returns the counter's current value. + /// + /// Can only be used if no labels have been defined. + + void inc(double v = 1.0); + /// Increments the counter's current value. + /// + /// Can only be used if no labels have been defined. + + // Collector + void exportTo(Exporter& exporter) const override; + +protected: + // LabeledMetricImpl + std::unique_ptr createSample() const override; + void writeSample(Exporter& exporter, const std::vector& labelValues, const CounterSample& sample) const override; + +private: + CounterSample _sample; +}; + + +// +// inlines +// + + +inline double CounterSample::value() const +{ + return _value.value(); +} + + +inline Poco::Timestamp CounterSample::timestamp() const +{ + return 0; +} + + +inline void CounterSample::inc(double v) +{ + poco_assert_dbg (v >= 0.0); + + _value += v; +} + + +inline Counter& Counter::help(const std::string& text) +{ + setHelp(text); + return *this; +} + + +inline Counter& Counter::labelNames(const std::vector& labelNames) +{ + setLabelNames(labelNames); + return *this; +} + + +inline void Counter::inc(double v) +{ + _sample.inc(v); +} + + +} } // namespace Poco::Prometheus + + +#endif // Prometheus_Counter_INCLUDED diff --git a/Prometheus/include/Poco/Prometheus/Exporter.h b/Prometheus/include/Poco/Prometheus/Exporter.h new file mode 100644 index 000000000..abf2526eb --- /dev/null +++ b/Prometheus/include/Poco/Prometheus/Exporter.h @@ -0,0 +1,76 @@ +// +// Exporter.h +// +// Library: Prometheus +// Package: Core +// Module: Exporter +// +// Definition of the Exporter class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Prometheus_Exporter_INCLUDED +#define Prometheus_Exporter_INCLUDED + + +#include "Poco/Prometheus/Prometheus.h" +#include "Poco/Timestamp.h" +#include + + +namespace Poco { +namespace Prometheus { + + +class Metric; + + +class Prometheus_API Exporter + /// The Exporter interface is used to format and write metrics + /// to an output stream. +{ +public: + virtual void writeHeader(const Metric& metric) = 0; + /// Writes the header (HELP and TYPE in text format). + + virtual void writeSample(const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, float value, const Poco::Timestamp& timestamp = 0) = 0; + /// Writes a sample for the given metric and the given labels. + + virtual void writeSample(const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, double value, const Poco::Timestamp& timestamp = 0) = 0; + /// Writes a sample for the given metric and the given labels. + + virtual void writeSample(const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, Poco::UInt32 value, const Poco::Timestamp& timestamp = 0) = 0; + /// Writes a sample for the given metric and the given labels. + + virtual void writeSample(const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, Poco::Int32 value, const Poco::Timestamp& timestamp = 0) = 0; + /// Writes a sample for the given metric and the given labels. + + virtual void writeSample(const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, Poco::UInt64 value, const Poco::Timestamp& timestamp = 0) = 0; + /// Writes a sample for the given metric and the given labels. + + virtual void writeSample(const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, Poco::Int64 value, const Poco::Timestamp& timestamp = 0) = 0; + /// Writes a sample for the given metric and the given labels. + + virtual void writeSample(const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, const std::string& value, const Poco::Timestamp& timestamp = 0) = 0; + /// Writes a sample for the given metric and the given labels. + +protected: + Exporter() = default; + virtual ~Exporter() = default; + + Exporter(const Exporter&) = delete; + Exporter(Exporter&&) = delete; + Exporter& operator = (const Exporter&) = delete; + Exporter& operator = (Exporter&&) = delete; +}; + + +} } // namespace Poco::Prometheus + + +#endif // Prometheus_Exporter_INCLUDED diff --git a/Prometheus/include/Poco/Prometheus/Gauge.h b/Prometheus/include/Poco/Prometheus/Gauge.h new file mode 100644 index 000000000..fc08af136 --- /dev/null +++ b/Prometheus/include/Poco/Prometheus/Gauge.h @@ -0,0 +1,273 @@ +// +// Gauge.h +// +// Library: Prometheus +// Package: Core +// Module: Gauge +// +// Definition of the Gauge class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Prometheus_Gauge_INCLUDED +#define Prometheus_Gauge_INCLUDED + + +#include "Poco/Prometheus/LabeledMetricImpl.h" +#include "Poco/Prometheus/AtomicFloat.h" +#include "Poco/Clock.h" +#include "Poco/Mutex.h" + + +namespace Poco { +namespace Prometheus { + + +class Prometheus_API GaugeSample +{ +public: + GaugeSample() = default; + /// Creates the GaugeSample. + + ~GaugeSample() = default; + /// Destroys the GaugeSample. + + double value() const; + /// Returns the Gauge's current value. + + Poco::Timestamp timestamp() const; + /// Returns the sample's timestamp, which in this + /// implementation is always 0. + + void inc(double v = 1.0); + /// Increments the Gauge's current value. + + void dec(double v = 1.0); + /// Decrements the Gauge's current value. + + void set(double v); + /// Sets the Gauge's current value. + + void set(Poco::Clock::ClockVal v); + /// Sets the Gauge's current value to the + /// given Clock value, converted to seconds. + + void setToCurrentTime(); + /// Sets the Gauge's current value to the current epoch time + /// (seconds since midnight January 1st 1970). + +private: + AtomicFloat _value; + + GaugeSample(const GaugeSample&) = delete; + GaugeSample(GaugeSample&&) = delete; + GaugeSample& operator = (const GaugeSample&) = delete; + GaugeSample& operator = (GaugeSample&&) = delete; +}; + + +class Prometheus_API Gauge: public LabeledMetricImpl + /// A generic gauge supporting labels. + /// + /// + /// To create a Gauge with labels and register it + /// with the default Registry: + /// Gauge sampleGauge("sample_gauge"s, { + /// .help = "A sample gauge"s, + /// .labelNames = {"label1"s, "label2"s} + /// }); + /// + /// To increment a Gauge (with labels): + /// sampleGauge.labels({"value1"s, "value2"}).inc(); + /// + /// To create a Gauge without labels and register it + /// with the default Registry: + /// Gauge simpleGauge("simple_gauge"s); + /// simpleGauge.help("A simple gauge"s); + /// + /// To set the value of a Gauge (without labels): + /// simpleGauge.set(42); +{ +public: + struct Params + { + std::string help; + std::vector labelNames; + }; + + explicit Gauge(const std::string& name); + /// Creates a Gauge with the given name and + /// registers it with the default registry. + + Gauge(const std::string& name, const Params& params); + /// Creates a Gauge with the given name and params and + /// registers it with the default registry. + + Gauge(const std::string& name, Registry* pRegistry); + /// Creates a Gauge with the given name and + /// registers it with the given registry (if not nullptr). + + Gauge(const std::string& name, const Params& params, Registry* pRegistry); + /// Creates a Gauge with the given name and params, and + /// registers it with the given registry (if not nullptr). + + ~Gauge() = default; + /// Destroys the Gauge. + + using LabeledMetric::help; + Gauge& help(const std::string& text); + /// Sets the Gauge's help text. + /// + /// Must only be set once, immediately after creating + /// the Gauge. + + using LabeledMetric::labelNames; + Gauge& labelNames(const std::vector& labelNames); + /// Sets the Gauge's label names. + /// + /// Must only be set once, immediately after creating + /// the Gauge. + + double value() const; + /// Returns the Gauge's current value. + /// + /// Can only be used if no labels have been defined. + + void inc(double v = 1.0); + /// Increments the Gauge's current value. + /// + /// Can only be used if no labels have been defined. + + void dec(double v = 1.0); + /// Decrements the Gauge's current value. + /// + /// Can only be used if no labels have been defined. + + void set(double v); + /// Sets the Gauge's current value. + /// + /// Can only be used if no labels have been defined. + + void set(Poco::Clock::ClockVal v); + /// Sets the Gauge's current value to the + /// given Clock value, converted to seconds. + /// + /// Can only be used if no labels have been defined. + + void setToCurrentTime(); + /// Sets the Gauge's current value to the current epoch time + /// (seconds since midnight January 1st 1970). + + // Collector + void exportTo(Exporter& exporter) const override; + +protected: + // LabeledMetricImpl + std::unique_ptr createSample() const override; + void writeSample(Exporter& exporter, const std::vector& labelValues, const GaugeSample& sample) const override; + +private: + GaugeSample _sample; +}; + + +// +// inlines +// + + +inline double GaugeSample::value() const +{ + return _value.value(); +} + + +inline Poco::Timestamp GaugeSample::timestamp() const +{ + return 0; +} + + +inline void GaugeSample::inc(double v) +{ + _value += v; +} + + +inline void GaugeSample::dec(double v) +{ + _value -= v; +} + + +inline void GaugeSample::set(double v) +{ + _value = v; +} + + +inline void GaugeSample::set(Poco::Clock::ClockVal v) +{ + _value = static_cast(v)/Poco::Clock::resolution(); +} + + +inline void GaugeSample::setToCurrentTime() +{ + _value = static_cast(Poco::Timestamp().epochMicroseconds()/1000)/1000.0; +} + + +inline Gauge& Gauge::help(const std::string& text) +{ + setHelp(text); + return *this; +} + + +inline Gauge& Gauge::labelNames(const std::vector& labelNames) +{ + setLabelNames(labelNames); + return *this; +} + + +inline void Gauge::inc(double v) +{ + _sample.inc(v); +} + + +inline void Gauge::dec(double v) +{ + _sample.dec(v); +} + + +inline void Gauge::set(double v) +{ + _sample.set(v); +} + + +inline void Gauge::set(Poco::Clock::ClockVal v) +{ + _sample.set(v); +} + + +inline void Gauge::setToCurrentTime() +{ + _sample.setToCurrentTime(); +} + + +} } // namespace Poco::Prometheus + + +#endif // Prometheus_Gauge_INCLUDED diff --git a/Prometheus/include/Poco/Prometheus/Histogram.h b/Prometheus/include/Poco/Prometheus/Histogram.h new file mode 100644 index 000000000..811e773cf --- /dev/null +++ b/Prometheus/include/Poco/Prometheus/Histogram.h @@ -0,0 +1,236 @@ +// +// Histogram.h +// +// Library: Prometheus +// Package: Core +// Module: Histogram +// +// Definition of the Histogram class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Prometheus_Histogram_INCLUDED +#define Prometheus_Histogram_INCLUDED + + +#include "Poco/Prometheus/LabeledMetricImpl.h" +#include "Poco/Clock.h" +#include "Poco/Mutex.h" +#include + + +namespace Poco { +namespace Prometheus { + + +struct Prometheus_API HistogramData +{ + std::vector bucketCounts; + /// Counter for each bucket. + + double sum; + /// Sum of all observations. + + Poco::UInt64 count; + /// Total number of observations. +}; + + +class Prometheus_API HistogramSample +{ +public: + explicit HistogramSample(const std::vector& bucketBounds); + /// Creates the HistogramSample. + + ~HistogramSample() = default; + /// Destroys the HistogramSample. + + void observe(double value); + /// Observes the given amount, by increasing the count + /// in the respective bucket. + + void observe(Poco::Clock::ClockVal v); + /// Converts the given Clock time in microseconds to + /// seconds and increases the count in the respective + /// bucket. + /// + /// Can only be used if no labels have been defined. + + HistogramData data() const; + /// Returns the histogram's data. + + const std::vector& bucketBounds() const; + /// Returns the buckets upper bounds; + +private: + const std::vector& _bucketBounds; + std::vector _bucketCounts; + Poco::UInt64 _count = 0; + double _sum = 0.0; + mutable Poco::FastMutex _mutex; + + HistogramSample() = delete; + HistogramSample(const HistogramSample&) = delete; + HistogramSample(HistogramSample&&) = delete; + HistogramSample& operator = (const HistogramSample&) = delete; + HistogramSample& operator = (HistogramSample&&) = delete; +}; + + +class Prometheus_API Histogram: public LabeledMetricImpl + /// A histogram with a configurable number of buckets. + /// + /// To create a Histogram with labels and three buckets, and register it + /// with the default Registry: + /// Histogram sampleHistogram("sample_histogram"s, { + /// .help = "A sample histogram"s, + /// .labelNames = {"label1"s, "label2"s}, + /// .buckets = {0.5, 1.0, 5.0} + /// }); + /// + /// To observe a value with a Histogram (with labels): + /// sampleHistogram.labels({"value1"s, "value2"}).observe(1.5); + /// + /// To create a Histogram without labels and register it + /// with the default Registry: + /// Histogram simpleHistogram("simple_histogram"s, { + /// .help = "A simple histogram"s, + /// .buckets = {0.5, 1.0, 5.0} + /// }); + /// + /// To observe a value with a Histogram (without labels): + /// simpleHistogram.observe(1.5); +{ +public: + struct Params + { + std::string help; + std::vector labelNames; + std::vector buckets; + }; + + explicit Histogram(const std::string& name); + /// Creates a Histogram with the given name and + /// registers it with the default registry. + + Histogram(const std::string& name, const Params& params); + /// Creates a Histogram with the given name and params, and + /// registers it with the default registry. + + Histogram(const std::string& name, Registry* pRegistry); + /// Creates a Histogram with the given name and + /// registers it with the given registry (if not nullptr). + + Histogram(const std::string& name, const Params& params, Registry* pRegistry); + /// Creates a Histogram with the given name and params, and + /// registers it with the given registry (if not nullptr). + + ~Histogram() = default; + /// Destroys the Histogram. + + using Metric::help; + Histogram& help(const std::string& text); + /// Sets the Histogram's help text. + /// + /// Must only be set once, immediately after creating + /// the Histogram. + + using LabeledMetric::labelNames; + Histogram& labelNames(const std::vector& labelNames); + /// Sets the Histogram's label names. + /// + /// Must only be set once, immediately after creating + /// the Gauge. The label name "le" must not be used + /// as it is reserved for the histogram. + + Histogram& buckets(const std::vector& bucketBounds); + /// Sets the Histogram's bucket upper bounds. + /// + /// Upper bounds must be strictly ordered from lowest to highest + /// value. The final infinite bucket must not be included. + /// + /// Must only be set once, immediately after creating + /// the Histogram. + + const std::vector buckets() const; + /// Returns the configured bucket upper bounds. + + void observe(double value); + /// Observes the given amount, by increasing the count + /// in the respective bucket. + + void observe(Poco::Clock::ClockVal v); + /// Converts the given Clock time in microseconds to + /// seconds and increases the count in the respective + /// bucket. + /// + /// Can only be used if no labels have been defined. + + HistogramData data() const; + /// Returns the histogram's data. + + // LabeledMetricImpl + std::unique_ptr createSample() const override; + + // Collector + void exportTo(Exporter& exporter) const override; + +private: + std::vector _bucketBounds; + mutable Poco::FastMutex _mutex; +}; + + +// +// inlines +// + + +inline const std::vector& HistogramSample::bucketBounds() const +{ + return _bucketBounds; +} + + +inline HistogramData HistogramSample::data() const +{ + Poco::FastMutex::ScopedLock lock(_mutex); + + HistogramData data; + data.bucketCounts = _bucketCounts; + data.count = _count; + data.sum = _sum; + + return data; +} + + +inline Histogram& Histogram::help(const std::string& text) +{ + setHelp(text); + return *this; +} + + +inline Histogram& Histogram::labelNames(const std::vector& labelNames) +{ + setLabelNames(labelNames); + return *this; +} + + +inline const std::vector Histogram::buckets() const +{ + return _bucketBounds; +} + + +} } // namespace Poco::Prometheus + + +#endif // Prometheus_Gauge_INCLUDED diff --git a/Prometheus/include/Poco/Prometheus/IntCounter.h b/Prometheus/include/Poco/Prometheus/IntCounter.h new file mode 100644 index 000000000..429a94931 --- /dev/null +++ b/Prometheus/include/Poco/Prometheus/IntCounter.h @@ -0,0 +1,153 @@ +// +// IntCounter.h +// +// Library: Prometheus +// Package: Core +// Module: IntCounter +// +// Definition of the IntCounter class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Prometheus_IntCounter_INCLUDED +#define Prometheus_IntCounter_INCLUDED + + +#include "Poco/Prometheus/Metric.h" +#include + + +namespace Poco { +namespace Prometheus { + + +class Registry; + + +class Prometheus_API IntCounter: public Metric + /// IntCounter is a very low overhead implementation of + /// a Counter, supporting 64-bit unsigned integer values + /// only, using std::atomic + /// + /// Labels are not supported. +{ +public: + using Sample = Poco::UInt64; + + struct Params + { + std::string help; + }; + + explicit IntCounter(const std::string& name); + /// Creates a IntCounter with the given name and + /// registers it with the default registry. + + IntCounter(const std::string& name, const Params& params); + /// Creates a IntCounter with the given name and help text (via params), and + /// registers it with the default registry. + + IntCounter(const std::string& name, Registry* pRegistry); + /// Creates a IntCounter with the given name and + /// registers it with the given registry (if not nullptr). + + IntCounter(const std::string& name, const Params& params, Registry* pRegistry); + /// Creates a IntCounter with the given name and help text (via params), and + /// registers it with the given registry (if not nullptr). + + ~IntCounter() = default; + /// Destroys the IntCounter. + + using Metric::help; + IntCounter& help(const std::string& text); + /// Sets the IntCounter's help text. + /// + /// Must only be set once, immediately after creating + /// the IntCounter. + + Sample value() const; + /// Returns the IntCounter's current value. + + void inc(); + /// Increments the IntCounter's current value by one. + + void inc(Sample v); + /// Increments the IntCounter's current value by the given value. + + void setToCurrentTime(); + /// Sets the Gauge's current value to the current epoch time + /// (seconds since midnight January 1st 1970). + + // Collector + void exportTo(Exporter& exporter) const override; + +private: + std::atomic _value{0}; +}; + + +// +// inlines +// + + +inline IntCounter::IntCounter(const std::string& name): + Metric(Metric::Type::COUNTER, name) +{ +} + + +inline IntCounter::IntCounter(const std::string& name, const Params& params): + Metric(Metric::Type::COUNTER, name) +{ + setHelp(params.help); +} + + +inline IntCounter::IntCounter(const std::string& name, Registry* pRegistry): + Metric(Metric::Type::COUNTER, name, pRegistry) +{ +} + + +inline IntCounter::IntCounter(const std::string& name, const Params& params, Registry* pRegistry): + Metric(Metric::Type::COUNTER, name, pRegistry) +{ + setHelp(params.help); +} + + +inline IntCounter& IntCounter::help(const std::string& text) +{ + setHelp(text); + return *this; +} + + +inline IntCounter::Sample IntCounter::value() const +{ + return _value.load(std::memory_order_relaxed); +} + + +inline void IntCounter::inc() +{ + _value.fetch_add(1, std::memory_order_relaxed); +} + + +inline void IntCounter::inc(IntCounter::Sample v) +{ + _value.fetch_add(v, std::memory_order_relaxed); +} + + +} } // namespace Poco::Prometheus + + +#endif // Prometheus_IntCounter_INCLUDED diff --git a/Prometheus/include/Poco/Prometheus/IntGauge.h b/Prometheus/include/Poco/Prometheus/IntGauge.h new file mode 100644 index 000000000..3da636cac --- /dev/null +++ b/Prometheus/include/Poco/Prometheus/IntGauge.h @@ -0,0 +1,186 @@ +// +// IntGauge.h +// +// Library: Prometheus +// Package: Core +// Module: IntGauge +// +// Definition of the IntGauge class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Prometheus_IntGauge_INCLUDED +#define Prometheus_IntGauge_INCLUDED + + +#include "Poco/Prometheus/Metric.h" +#include + + +namespace Poco { +namespace Prometheus { + + +class Registry; + + +class Prometheus_API IntGauge: public Metric + /// IntGauge is a very low overhead implementation of + /// a Gauge, supporting 64-bit integer values only, + /// using std::atomic. + /// + /// Labels are not supported. +{ +public: + using Sample = Poco::Int64; + + struct Params + { + std::string help; + }; + + explicit IntGauge(const std::string& name); + /// Creates a IntGauge with the given name and + /// registers it with the default registry. + + IntGauge(const std::string& name, const Params& params); + /// Creates a IntGauge with the given name and help text (via params), and + /// registers it with the default registry. + + IntGauge(const std::string& name, Registry* pRegistry); + /// Creates a IntGauge with the given name and + /// registers it with the given registry (if not nullptr). + + IntGauge(const std::string& name, const Params& params, Registry* pRegistry); + /// Creates a IntGauge with the given name and help text (via params), and + /// registers it with the given registry (if not nullptr). + + ~IntGauge() = default; + /// Destroys the IntGauge. + + using Metric::help; + IntGauge& help(const std::string& text); + /// Sets the IntGauge's help text. + /// + /// Must only be set once, immediately after creating + /// the IntGauge. + + Sample value() const; + /// Returns the IntGauge's current value. + + void inc(); + /// Increments the IntGauge's current value by one. + + void dec(); + /// Decrements the IntGauge's current value by one. + + void inc(Sample v); + /// Increments the IntGauge's current value by the given value. + + void dec(Sample v); + /// Increments the IntGauge's current value by the given value. + + void set(Sample v); + /// Sets the IntGauge's current value. + + void setToCurrentTime(); + /// Sets the Gauge's current value to the current epoch time + /// (seconds since midnight January 1st 1970). + + // Collector + void exportTo(Exporter& exporter) const override; + +private: + std::atomic _value{0}; +}; + + +// +// inlines +// + + +inline IntGauge::IntGauge(const std::string& name): + Metric(Metric::Type::GAUGE, name) +{ +} + + +inline IntGauge::IntGauge(const std::string& name, const Params& params): + Metric(Metric::Type::GAUGE, name) +{ + setHelp(params.help); +} + + +inline IntGauge::IntGauge(const std::string& name, Registry* pRegistry): + Metric(Metric::Type::GAUGE, name, pRegistry) +{ +} + + +inline IntGauge::IntGauge(const std::string& name, const Params& params, Registry* pRegistry): + Metric(Metric::Type::GAUGE, name, pRegistry) +{ + setHelp(params.help); +} + + +inline IntGauge& IntGauge::help(const std::string& text) +{ + setHelp(text); + return *this; +} + + +inline IntGauge::Sample IntGauge::value() const +{ + return _value.load(std::memory_order_relaxed); +} + + +inline void IntGauge::inc() +{ + _value.fetch_add(1, std::memory_order_relaxed); +} + + +inline void IntGauge::dec() +{ + _value.fetch_sub(1, std::memory_order_relaxed); +} + + +inline void IntGauge::inc(IntGauge::Sample v) +{ + _value.fetch_add(v, std::memory_order_relaxed); +} + + +inline void IntGauge::dec(IntGauge::Sample v) +{ + _value.fetch_sub(v, std::memory_order_relaxed); +} + + +inline void IntGauge::set(IntGauge::Sample v) +{ + _value.exchange(v, std::memory_order_relaxed); +} + + +inline void IntGauge::setToCurrentTime() +{ + set(Poco::Timestamp().epochTime()); +} + + +} } // namespace Poco::Prometheus + + +#endif // Prometheus_IntGauge_INCLUDED diff --git a/Prometheus/include/Poco/Prometheus/LabeledMetric.h b/Prometheus/include/Poco/Prometheus/LabeledMetric.h new file mode 100644 index 000000000..393a304d8 --- /dev/null +++ b/Prometheus/include/Poco/Prometheus/LabeledMetric.h @@ -0,0 +1,95 @@ +// +// LabeledMetric.h +// +// Library: Prometheus +// Package: Core +// Module: LabeledMetric +// +// Definition of the LabeledMetric class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Prometheus_LabeledMetric_INCLUDED +#define Prometheus_LabeledMetric_INCLUDED + + +#include "Poco/Prometheus/Metric.h" +#include + + +namespace Poco { +namespace Prometheus { + + +class Prometheus_API LabeledMetric: public Metric + /// This class adds support for labels to the + /// basic Metric class. +{ +public: + const std::vector& labelNames() const; + /// Returns the metric's label names. + +protected: + LabeledMetric(Type type, const std::string& name); + /// Creates a LabeledMetric with the given type and name, + /// and registers it with the default Registry. + /// + /// The name must be a valid metric name and match the regular + /// expression [a-zA-Z_:][a-zA-Z0-9_:]*. + + LabeledMetric(Type type, const std::string& name, Registry* pRegistry); + /// Creates a LabeledMetric with the given type and name, + /// and registers it with the given Registry (if not nullptr). + /// + /// The name must be a valid metric name and match the regular + /// expression [a-zA-Z_:][a-zA-Z0-9_:]*. + + void setLabelNames(const std::vector& labelNames); + /// Sets the metric's label names. + + virtual ~LabeledMetric() = default; + /// Destroys the LabeledMetric. + + static const std::string& validateLabelName(const std::string& name); + /// Validates the given name against the regular expression + /// defining a valid label name ([a-zA-Z_:][a-zA-Z0-9_:]*). + + static const std::vector EMPTY_LABEL; + +private: + std::vector _labelNames; +}; + + +// +// inlines +// + + +inline LabeledMetric::LabeledMetric(Type type, const std::string& name): + Metric(type, name) +{ +} + + +inline LabeledMetric::LabeledMetric(Type type, const std::string& name, Registry* pRegistry): + Metric(type, name, pRegistry) +{ +} + + +inline const std::vector& LabeledMetric::labelNames() const +{ + return _labelNames; +} + + +} } // namespace Poco::Prometheus + + +#endif // Prometheus_Metric_INCLUDED diff --git a/Prometheus/include/Poco/Prometheus/LabeledMetricImpl.h b/Prometheus/include/Poco/Prometheus/LabeledMetricImpl.h new file mode 100644 index 000000000..189d33870 --- /dev/null +++ b/Prometheus/include/Poco/Prometheus/LabeledMetricImpl.h @@ -0,0 +1,193 @@ +// +// LabeledMetricImpl.h +// +// Library: Prometheus +// Package: Core +// Module: LabeledMetric +// +// Definition of the MetricImpl class template. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Prometheus_LabeledMetricImpl_INCLUDED +#define Prometheus_LabeledMetricImpl_INCLUDED + + +#include "Poco/Prometheus/LabeledMetric.h" +#include "Poco/Prometheus/Exporter.h" +#include "Poco/AutoPtr.h" +#include "Poco/String.h" +#include "Poco/Format.h" +#include "Poco/Mutex.h" +#include +#include +#include + + +using namespace std::string_literals; + + +namespace Poco { +namespace Prometheus { + + +template +class LabeledMetricImpl: public LabeledMetric + /// A helper class for implementing LabeledMetric classes such as Counter, Gauge and Histogram. + /// + /// This class takes care of managing label values and samples. +{ +public: + using Sample = S; + using ProcessingFunction = std::function&, const Sample&)>; + + LabeledMetricImpl(Type type, const std::string& name): + LabeledMetric(type, name) + { + } + + LabeledMetricImpl(Type type, const std::string& name, Registry* pRegistry): + LabeledMetric(type, name, pRegistry) + { + } + + Sample& labels(const std::vector& labelValues) + /// Returns the Sample associated with the given label values. + /// + /// If the sample does not exist yet, it is created. + /// + /// The returned reference can be cached by the caller. + { + if (labelValues.size() != labelNames().size()) + { + if (labelNames().empty()) + throw Poco::InvalidArgumentException(Poco::format("Metric %s does not have labels"s, name())); + else + throw Poco::InvalidArgumentException(Poco::format("Metric %s requires label values for %s"s, name(), Poco::cat(", "s, labelNames().begin(), labelNames().end()))); + } + + Poco::FastMutex::ScopedLock lock(_mutex); + + const auto it = _samples.find(labelValues); + if (it != _samples.end()) + { + return *it->second; + } + else + { + std::unique_ptr pUniqueSample = createSample(); + Sample* pSample = pUniqueSample.get(); + _samples[labelValues] = std::move(pUniqueSample); + return *pSample; + } + } + + const Sample& labels(const std::vector& labelValues) const + /// Returns the Sample associated with the given label values. + /// + /// If the sample does not exist, a Poco::NotFoundException is thrown. + /// + /// The returned reference can be cached by the caller. + { + if (labelValues.size() != labelNames().size()) + throw Poco::InvalidArgumentException(Poco::format("Metric %s requires label values for %s"s, name(), Poco::cat(", "s, labelNames().begin(), labelNames().end()))); + + Poco::FastMutex::ScopedLock lock(_mutex); + + const auto it = _samples.find(labelValues); + if (it != _samples.end()) + { + return *it->second; + } + else + { + throw Poco::NotFoundException("Label values"s, Poco::cat("|"s, labelValues.begin(), labelValues.end())); + } + } + + void remove(const std::vector& labelValues) + /// Removes the sample associated with the given label values. + { + if (labelValues.size() != labelNames().size()) + throw Poco::InvalidArgumentException(Poco::format("Metric %s requires label values for %s"s, name(), Poco::cat(", "s, labelNames().begin(), labelNames().end()))); + + if (labelNames().empty()) + throw Poco::InvalidAccessException("Metric has no labels"s); + + Poco::FastMutex::ScopedLock lock(_mutex); + + _samples.erase(labelValues); + } + + void clear() + /// Removes all samples. + { + Poco::FastMutex::ScopedLock lock(_mutex); + + _samples.clear(); + } + + std::size_t sampleCount() const + /// Returns the number of samples. + { + Poco::FastMutex::ScopedLock lock(_mutex); + + return _samples.size(); + } + + template + void forEach(ProcessingFunction func) const + /// Calls the given function for each Sample. + { + Poco::FastMutex::ScopedLock lock(_mutex); + + for (const auto& p: _samples) + { + func(p.first, *p.second); + } + } + + // Collector + void exportTo(Exporter& exporter) const override + { + Poco::FastMutex::ScopedLock lock(_mutex); + + exporter.writeHeader(*this); + for (const auto& p: _samples) + { + this->writeSample(exporter, p.first, *p.second); + } + } + +protected: + virtual std::unique_ptr createSample() const = 0; + /// Creates a new Sample. Must be overridden by subclasses. + + virtual void writeSample(Exporter& exporter, const std::vector& labelValues, const Sample& sample) const + /// Writes a Sample to the Exporter. + /// + /// Must be overridden by subclasses, unless the subclass + /// overrides the exportTo() method. + /// + /// The default implementation does nothing. + { + } + + ~LabeledMetricImpl() = default; + /// Destroys the LabeledMetricImpl. + +private: + std::map, std::unique_ptr> _samples; + mutable Poco::FastMutex _mutex; +}; + + +} } // namespace Poco::Prometheus + + +#endif // Prometheus_LabeledMetricImpl_INCLUDED diff --git a/Prometheus/include/Poco/Prometheus/Metric.h b/Prometheus/include/Poco/Prometheus/Metric.h new file mode 100644 index 000000000..92e006275 --- /dev/null +++ b/Prometheus/include/Poco/Prometheus/Metric.h @@ -0,0 +1,116 @@ +// +// Metric.h +// +// Library: Prometheus +// Package: Core +// Module: Metric +// +// Definition of the Metric class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Prometheus_Metric_INCLUDED +#define Prometheus_Metric_INCLUDED + + +#include "Poco/Prometheus/Collector.h" +#include "Poco/Prometheus/Registry.h" + + +namespace Poco { +namespace Prometheus { + + +class Prometheus_API Metric: public Collector + /// This is the base class for all metrics, such as + /// Counter, Gauge and Histogram. +{ +public: + enum class Type + { + COUNTER, + GAUGE, + HISTOGRAM, + SUMMARY, + UNTYPED + }; + + Type type() const; + /// Returns the metric's type. + + const std::string& help() const; + /// Returns the metric's help text. + + ~Metric() = default; + /// Destroys the Metric. + +protected: + Metric(Type type, const std::string& name); + /// Creates a Metric with the given type and name, + /// and registers it with the default Registry. + /// + /// The name must be a valid metric name and match the regular + /// expression [a-zA-Z_:][a-zA-Z0-9_:]*. + + Metric(Type type, const std::string& name, Registry* pRegistry); + /// Creates a Metric with the given type and name, + /// and registers it with the given Registry (if not nullptr). + /// + /// The name must be a valid metric name and match the regular + /// expression [a-zA-Z_:][a-zA-Z0-9_:]*. + + void setHelp(const std::string& help); + /// Sets the metric's help text. + +private: + const Type _type; + std::string _help; +}; + + +// +// inlines +// + + +inline Metric::Metric(Type type, const std::string& name): + Collector(name), + _type(type) +{ +} + + +inline Metric::Metric(Type type, const std::string& name, Registry* pRegistry): + Collector(name, pRegistry), + _type(type) +{ +} + + +inline Metric::Type Metric::type() const +{ + return _type; +} + + +inline const std::string& Metric::help() const +{ + return _help; +} + + +inline void Metric::setHelp(const std::string& help) +{ + _help = help; +} + + +} } // namespace Poco::Prometheus + + +#endif // Prometheus_Metric_INCLUDED diff --git a/Prometheus/include/Poco/Prometheus/MetricsRequestHandler.h b/Prometheus/include/Poco/Prometheus/MetricsRequestHandler.h new file mode 100644 index 000000000..6d6901e90 --- /dev/null +++ b/Prometheus/include/Poco/Prometheus/MetricsRequestHandler.h @@ -0,0 +1,54 @@ +// +// MetricsRequestHandler.h +// +// Library: Prometheus +// Package: HTTP +// Module: MetricsRequestHandler +// +// Definition of the MetricsRequestHandler class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Prometheus_MetricsRequestHandler_INCLUDED +#define Prometheus_MetricsRequestHandler_INCLUDED + + +#include "Poco/Prometheus/Prometheus.h" +#include "Poco/Net/HTTPRequestHandler.h" + + +namespace Poco { +namespace Prometheus { + + +class Registry; + + +class Prometheus_API MetricsRequestHandler: public Poco::Net::HTTPRequestHandler + /// This class handles incoming HTTP requests for metrics + /// in the Prometheus text format. +{ +public: + MetricsRequestHandler(); + /// Creates a HTTPRequestHandler using the default Registry. + + MetricsRequestHandler(const Registry& registry); + /// Creates a HTTPRequestHandler using the given Registry. + + // Poco::Net::HTTPRequestHandler + void handleRequest(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response) override; + +private: + const Registry& _registry; +}; + + +} } // namespace Poco::Prometheus + + +#endif // Prometheus_MetricsRequestHandler_INCLUDED diff --git a/Prometheus/include/Poco/Prometheus/MetricsServer.h b/Prometheus/include/Poco/Prometheus/MetricsServer.h new file mode 100644 index 000000000..51d9359db --- /dev/null +++ b/Prometheus/include/Poco/Prometheus/MetricsServer.h @@ -0,0 +1,80 @@ +// +// MetricsServer.h +// +// Library: Prometheus +// Package: HTTP +// Module: MetricsServer +// +// Definition of the MetricsServer class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Prometheus_MetricsServer_INCLUDED +#define Prometheus_MetricsServer_INCLUDED + + +#include "Poco/Prometheus/Prometheus.h" +#include "Poco/Net/HTTPServer.h" +#include "Poco/Net/HTTPServerParams.h" +#include "Poco/Net/ServerSocket.h" + + +namespace Poco { +namespace Prometheus { + + +class Registry; + + +class Prometheus_API MetricsServer + /// A basic HTTP server for handling Prometheus metrics scraping + /// requests, based on Poco::Net::HTTPServer. +{ +public: + static const Poco::UInt16 DEFAULT_PORT; /// 9100 + static const std::string DEFAULT_PATH; /// "/metrics" + + MetricsServer(Poco::UInt16 port = DEFAULT_PORT, const std::string& path = DEFAULT_PATH); + /// Creates a HTTPServer for serving metrics using the default Registry, listening + /// on the given port number and the given path. + + MetricsServer(const Registry& registry, Poco::UInt16 port = DEFAULT_PORT, const std::string& path = DEFAULT_PATH); + /// Creates a HTTPServer for serving metrics using the given Registry, listening + /// on the given port number and the given path. + + MetricsServer(const Registry& registry, Poco::Net::ServerSocket& socket, Poco::Net::HTTPServerParams::Ptr pServerParams = defaultParams(), const std::string& path = DEFAULT_PATH); + /// Creates a HTTPServer for serving metrics using the given Registry, listening + /// on the server socket (which can be a properly configured Poco::Net::SecureServerSocket + /// to enable HTTPS), and the given path. + + ~MetricsServer() = default; + /// Destroys the HTTPServer. + + void start(); + /// Starts the underlying Poco::Net::HTTPServer. + + void stop(); + /// Stops the underlying Poco::Net::HTTPServer. + +protected: + static Poco::Net::HTTPServerParams::Ptr defaultParams(); + +private: + Poco::Net::HTTPServer _httpServer; + + MetricsServer(const MetricsServer&) = delete; + MetricsServer(MetricsServer&&) = delete; + MetricsServer& operator = (const MetricsServer&) = delete; + MetricsServer& operator = (MetricsServer&&) = delete; +}; + + +} } // namespace Poco::Prometheus + + +#endif // Prometheus_MetricsServer_INCLUDED diff --git a/Prometheus/include/Poco/Prometheus/ProcessCollector.h b/Prometheus/include/Poco/Prometheus/ProcessCollector.h new file mode 100644 index 000000000..8b109796e --- /dev/null +++ b/Prometheus/include/Poco/Prometheus/ProcessCollector.h @@ -0,0 +1,83 @@ +// +// ProcessCollector.h +// +// Library: Prometheus +// Package: Collectors +// Module: ProcessCollector +// +// Definition of the ProcessCollector class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Prometheus_ProcessCollector_INCLUDED +#define Prometheus_ProcessCollector_INCLUDED + + +#include "Poco/Prometheus/Collector.h" +#include "Poco/Prometheus/CallbackMetric.h" +#include "Poco/Timestamp.h" +#include +#include + + +namespace Poco { +namespace Prometheus { + + +class Prometheus_API ProcessCollector: public Collector + /// This Collector provides process-specific metrics: + /// - process_cpu_seconds_total: Total user and system CPU time spent in seconds. + /// - process_max_fds: Maximum number of open file descriptors. + /// - process_start_time_seconds: Start time of the process since unix epoch in seconds + /// (actually, the time the Prometheus library was loaded). + /// - process_up_time_seconds: Up time of the process in seconds + /// (actually, time since the Prometheus library was loaded). +{ +public: + ProcessCollector(); + /// Creates a default ProcessCollector. + + ProcessCollector(const std::string& name, Registry* pRegistry); + /// Creates a custom ProcessCollector with the given name (prefix) + /// and registers it with the given Registry. + + ~ProcessCollector() = default; + /// Destroys the ProcessCollector. + + static Poco::Timestamp startTime(); + /// Returns the process start time. + + // Collector + void exportTo(Exporter& exporter) const override; + /// Writes the given Metric to the Exporter. + +protected: + void buildMetrics(); + +private: + using MetricPtr = std::unique_ptr; + std::vector _metrics; + static Poco::Timestamp _startTime; +}; + + +// +// inlines +// + + +inline Poco::Timestamp ProcessCollector::startTime() +{ + return _startTime; +} + + +} } // namespace Poco::Prometheus + + +#endif // Prometheus_ProcessCollector_INCLUDED diff --git a/Prometheus/include/Poco/Prometheus/Prometheus.h b/Prometheus/include/Poco/Prometheus/Prometheus.h new file mode 100644 index 000000000..b30365785 --- /dev/null +++ b/Prometheus/include/Poco/Prometheus/Prometheus.h @@ -0,0 +1,62 @@ +// +// Prometheus.h +// +// Library: Prometheus +// Package: Core +// Module: Prometheus +// +// Basic definitions for the Poco Prometheus library. +// This file must be the first file included by every other Prometheus +// header file. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Prometheus_Prometheus_INCLUDED +#define Prometheus_Prometheus_INCLUDED + + +#include "Poco/Foundation.h" + + +// +// The following block is the standard way of creating macros which make exporting +// from a DLL simpler. All files within this DLL are compiled with the Prometheus_EXPORTS +// symbol defined on the command line. this symbol should not be defined on any project +// that uses this DLL. This way any other project whose source files include this file see +// Prometheus_API functions as being imported from a DLL, whereas this DLL sees symbols +// defined with this macro as being exported. +// +#if defined(_WIN32) && defined(POCO_DLL) + #if defined(Prometheus_EXPORTS) + #define Prometheus_API __declspec(dllexport) + #else + #define Prometheus_API __declspec(dllimport) + #endif +#endif + + +#if !defined(Prometheus_API) + #if !defined(POCO_NO_GCC_API_ATTRIBUTE) && defined (__GNUC__) && (__GNUC__ >= 4) + #define Prometheus_API __attribute__ ((visibility ("default"))) + #else + #define Prometheus_API + #endif +#endif + + +// +// Automatically link Prometheus library. +// +#if defined(_MSC_VER) + #if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(Prometheus_EXPORTS) + #pragma comment(lib, "PocoPrometheus" POCO_LIB_SUFFIX) + #endif +#endif + + +#endif // Prometheus_Prometheus_INCLUDED diff --git a/Prometheus/include/Poco/Prometheus/Registry.h b/Prometheus/include/Poco/Prometheus/Registry.h new file mode 100644 index 000000000..2be5076a8 --- /dev/null +++ b/Prometheus/include/Poco/Prometheus/Registry.h @@ -0,0 +1,101 @@ +// +// Registry.h +// +// Library: Prometheus +// Package: Core +// Module: Registry +// +// Definition of the Registry class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Prometheus_Registry_INCLUDED +#define Prometheus_Registry_INCLUDED + + +#include "Poco/Prometheus/Prometheus.h" +#include "Poco/Mutex.h" +#include + + +namespace Poco { +namespace Prometheus { + + +class Collector; +class Exporter; + + +class Prometheus_API Registry + /// The metric registry is a collection of all active + /// Collector instances. + /// + /// The Registry internally stores plain pointers to Collector + /// objects. Collector objects automatically register themselves + /// with the default Registry (unless a nullptr is passed to the + /// constructor's pRegistry parameter), but do not automatically + /// unregister. This brings the danger of dangling pointers if + /// Collector instances are destroyed without being explicitly + /// unregistered first. In most practical cases this is not an + /// issue as Collector instances will be alive for the entire + /// run time of the process. However, it can be an issue if + /// Collector instances are created and destroyed dynamically + /// during the run time of the process. +{ +public: + Registry() = default; + /// Creates the Registry. + + ~Registry() = default; + /// Destroys the Registry. + + void registerCollector(Collector* pCollector); + /// Registers a Collector with the Registry. + /// + /// An attempt to register a collector with the name + /// of an already registered collector will fail with + /// a Poco::ExistsException. + + void unregisterCollector(Collector* pCollector); + /// Removes a Collector from the Registry. + + void unregisterCollector(const std::string& collectorName); + /// Removes the Collector with the given name from the Registry. + /// + /// Does nothing if no collector with the given name has been registered. + + Collector* findCollector(const std::string& collectorName) const; + /// Looks up the Collector with the given name. + /// + /// Returns a pointer to the collector instance if found, + /// otherwise returns a nullptr. + + void clear(); + /// Removes all Collector instances from the Registry. + + void exportTo(Exporter& exporter) const; + /// Exports all registered collector's metrics through the given Exporter. + + static Registry& defaultRegistry(); + /// Returns the default Registry. + +private: + std::map _collectors; + mutable Poco::FastMutex _mutex; + + Registry(const Registry&) = delete; + Registry(Registry&&) = delete; + Registry& operator = (const Registry&) = delete; + Registry& operator = (Registry&&) = delete; +}; + + +} } // namespace Poco::Prometheus + + +#endif // Prometheus_Metric_INCLUDED diff --git a/Prometheus/include/Poco/Prometheus/TextExporter.h b/Prometheus/include/Poco/Prometheus/TextExporter.h new file mode 100644 index 000000000..d9ec86cef --- /dev/null +++ b/Prometheus/include/Poco/Prometheus/TextExporter.h @@ -0,0 +1,73 @@ +// +// TextExporter.h +// +// Library: Prometheus +// Package: Core +// Module: TextExporter +// +// Definition of the TextExporter class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Prometheus_TextExporter_INCLUDED +#define Prometheus_TextExporter_INCLUDED + + +#include "Poco/Prometheus/Exporter.h" +#include "Poco/Prometheus/Metric.h" +#include + + +namespace Poco { +namespace Prometheus { + + +class Prometheus_API TextExporter: public Exporter + /// Exporter implementation for the Prometheus text format. + /// + /// See https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md + /// for the specification of the Prometheus text exposition format. +{ +public: + explicit TextExporter(std::ostream& ostr); + /// Creates the TextExporter for the given output stream. + + TextExporter() = delete; + TextExporter(const TextExporter&) = delete; + TextExporter& operator = (const TextExporter&) = delete; + + ~TextExporter() = default; + + // Exporter + void writeHeader(const Metric& metric) override; + void writeSample(const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, float value, const Poco::Timestamp& timestamp = 0) override; + void writeSample(const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, double value, const Poco::Timestamp& timestamp = 0) override; + void writeSample(const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, Poco::UInt32 value, const Poco::Timestamp& timestamp = 0) override; + void writeSample(const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, Poco::Int32 value, const Poco::Timestamp& timestamp = 0) override; + void writeSample(const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, Poco::UInt64 value, const Poco::Timestamp& timestamp = 0) override; + void writeSample(const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, Poco::Int64 value, const Poco::Timestamp& timestamp = 0) override; + void writeSample(const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, const std::string& value, const Poco::Timestamp& timestamp = 0) override; + +protected: + static const std::string& typeToString(Metric::Type type); + + static const std::string COUNTER; + static const std::string GAUGE; + static const std::string HISTOGRAM; + static const std::string SUMMARY; + static const std::string UNTYPED; + +private: + std::ostream& _stream; +}; + + +} } // namespace Poco::Prometheus + + +#endif // Prometheus_TextExporter_INCLUDED diff --git a/Prometheus/include/Poco/Prometheus/ThreadPoolCollector.h b/Prometheus/include/Poco/Prometheus/ThreadPoolCollector.h new file mode 100644 index 000000000..62ed2a5d1 --- /dev/null +++ b/Prometheus/include/Poco/Prometheus/ThreadPoolCollector.h @@ -0,0 +1,79 @@ +// +// ThreadPoolCollector.h +// +// Library: Prometheus +// Package: Collectors +// Module: ThreadPoolCollector +// +// Definition of the ThreadPoolCollector class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef Prometheus_ThreadPoolCollector_INCLUDED +#define Prometheus_ThreadPoolCollector_INCLUDED + + +#include "Poco/Prometheus/Collector.h" +#include "Poco/Prometheus/CallbackMetric.h" +#include "Poco/ThreadPool.h" +#include +#include + + +namespace Poco { +namespace Prometheus { + + +class Prometheus_API ThreadPoolCollector: public Collector + /// This Collector provides Poco::ThreadPool specific metrics: + /// - poco_threadpool_max_threads: Maximum number of threads available in the thread pool (capacity). + /// - poco_threadpool_used_threads: Number of currently used threads. + /// - poco_threadpool_allocated_threads: Number of currently allocated threads. + /// + /// Metrics have a single label "name" identifying the thread pool. + /// The name of the default thread pool is "default". +{ +public: + ThreadPoolCollector(); + /// Creates a default ThreadPoolCollector for the default Poco::ThreadPool. + + explicit ThreadPoolCollector(const Poco::ThreadPool& threadPool); + /// Creates a default ThreadPoolCollector for the given Poco::ThreadPool. + /// The Poco::ThreadPool must have a non-empty name and the name must + /// be unique across all ThreadPoolCollector instances. + + ThreadPoolCollector(const std::string& name, const Poco::ThreadPool& threadPool, Registry* pRegistry); + /// Creates a custom ThreadPoolCollector with the given name + /// and registers it with the given Registry. + + ~ThreadPoolCollector() = default; + /// Destroys the ThreadPoolCollector. + + // Collector + void exportTo(Exporter& exporter) const override; + /// Writes the given Metric to the Exporter. + +protected: + void buildMetrics(); + + static std::string collectorName(const std::string& threadPoolName); + + static const std::string NAME_PREFIX; + +private: + using MetricPtr = std::unique_ptr; + const std::string _threadPoolName; + const Poco::ThreadPool& _threadPool; + std::vector _metrics; +}; + + +} } // namespace Poco::Prometheus + + +#endif // Prometheus_ThreadPoolCollector_INCLUDED diff --git a/Prometheus/samples/CMakeLists.txt b/Prometheus/samples/CMakeLists.txt new file mode 100644 index 000000000..fa6fd674d --- /dev/null +++ b/Prometheus/samples/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(MetricsSample) diff --git a/Prometheus/samples/Makefile b/Prometheus/samples/Makefile new file mode 100644 index 000000000..236cef1ae --- /dev/null +++ b/Prometheus/samples/Makefile @@ -0,0 +1,10 @@ +# +# Makefile +# +# Makefile for Poco Prometheus Samples +# + +.PHONY: projects +clean all: projects +projects: + $(MAKE) -C MetricsSample $(MAKECMDGOALS) diff --git a/Prometheus/samples/MetricsSample/CMakeLists.txt b/Prometheus/samples/MetricsSample/CMakeLists.txt new file mode 100644 index 000000000..0c39f7108 --- /dev/null +++ b/Prometheus/samples/MetricsSample/CMakeLists.txt @@ -0,0 +1,2 @@ +add_executable(MetricsSample src/MetricsSample.cpp) +target_link_libraries(MetricsSample PUBLIC Poco::Prometheus Poco::Util Poco::Net) diff --git a/Prometheus/samples/MetricsSample/Makefile b/Prometheus/samples/MetricsSample/Makefile new file mode 100644 index 000000000..941ae37eb --- /dev/null +++ b/Prometheus/samples/MetricsSample/Makefile @@ -0,0 +1,15 @@ +# +# Makefile +# +# Makefile for MetricsSample +# + +include $(POCO_BASE)/build/rules/global + +objects = MetricsSample + +target = MetricsSample +target_version = $(LIBVERSION) +target_libs = PocoPrometheus PocoNet PocoUtil PocoXML PocoJSON PocoFoundation + +include $(POCO_BASE)/build/rules/exec diff --git a/Prometheus/samples/MetricsSample/MetricsSample.progen b/Prometheus/samples/MetricsSample/MetricsSample.progen new file mode 100644 index 000000000..576db0374 --- /dev/null +++ b/Prometheus/samples/MetricsSample/MetricsSample.progen @@ -0,0 +1,10 @@ +vc.project.guid = ${vc.project.guidFromName} +vc.project.name = ${vc.project.baseName} +vc.project.target = ${vc.project.name} +vc.project.type = executable +vc.project.pocobase = ..\\..\\.. +vc.project.platforms = Win32 +vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md +vc.project.prototype = ${vc.project.name}_vs90.vcproj +vc.project.compiler.include = ..\\..\\..\\Foundation\\include;..\\..\\..\\Util\\include;..\\..\\..\\XML\\include;..\\..\\..\\JSON\\include;..\\..\\..\\Net\\include;..\\..\\..\\Prometheus\\include +vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib diff --git a/Prometheus/samples/MetricsSample/MetricsSample_vs140.vcxproj b/Prometheus/samples/MetricsSample/MetricsSample_vs140.vcxproj new file mode 100644 index 000000000..b66be6952 --- /dev/null +++ b/Prometheus/samples/MetricsSample/MetricsSample_vs140.vcxproj @@ -0,0 +1,607 @@ + + + + + debug_shared + Win32 + + + debug_shared + x64 + + + debug_static_md + Win32 + + + debug_static_md + x64 + + + debug_static_mt + Win32 + + + debug_static_mt + x64 + + + release_shared + Win32 + + + release_shared + x64 + + + release_static_md + Win32 + + + release_static_md + x64 + + + release_static_mt + Win32 + + + release_static_mt + x64 + + + + MetricsSample + {D256BB4C-7287-3E74-BC1A-31E116A8CE36} + MetricsSample + Win32Proj + + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>14.0.25420.1 + MetricsSampled + MetricsSampled + MetricsSampled + MetricsSample + MetricsSample + MetricsSample + MetricsSampled + MetricsSampled + MetricsSampled + MetricsSample + MetricsSample + MetricsSample + + + bin\ + obj\MetricsSample\$(Configuration)\ + true + + + bin\ + obj\MetricsSample\$(Configuration)\ + false + + + bin\static_mt\ + obj\MetricsSample\$(Configuration)\ + true + + + bin\static_mt\ + obj\MetricsSample\$(Configuration)\ + false + + + bin\static_md\ + obj\MetricsSample\$(Configuration)\ + true + + + bin\static_md\ + obj\MetricsSample\$(Configuration)\ + false + + + bin64\ + obj64\MetricsSample\$(Configuration)\ + true + + + bin64\ + obj64\MetricsSample\$(Configuration)\ + false + + + bin64\static_mt\ + obj64\MetricsSample\$(Configuration)\ + true + + + bin64\static_mt\ + obj64\MetricsSample\$(Configuration)\ + false + + + bin64\static_md\ + obj64\MetricsSample\$(Configuration)\ + true + + + bin64\static_md\ + obj64\MetricsSample\$(Configuration)\ + false + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\MetricsSampled.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\MetricsSampled.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\MetricsSample.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\static_mt\MetricsSampled.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\static_mt\MetricsSampled.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\static_mt\MetricsSample.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\static_md\MetricsSampled.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\static_md\MetricsSampled.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\static_md\MetricsSample.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\MetricsSampled.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\MetricsSampled.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\MetricsSample.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\static_mt\MetricsSampled.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\static_mt\MetricsSampled.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\static_mt\MetricsSample.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\static_md\MetricsSampled.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\static_md\MetricsSampled.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\static_md\MetricsSample.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + true + + + + + diff --git a/Prometheus/samples/MetricsSample/MetricsSample_vs140.vcxproj.filters b/Prometheus/samples/MetricsSample/MetricsSample_vs140.vcxproj.filters new file mode 100644 index 000000000..7dee11eda --- /dev/null +++ b/Prometheus/samples/MetricsSample/MetricsSample_vs140.vcxproj.filters @@ -0,0 +1,13 @@ + + + + + {d576aae7-63b4-4733-ac41-46a4a2fbe5d2} + + + + + Source Files + + + \ No newline at end of file diff --git a/Prometheus/samples/MetricsSample/MetricsSample_vs150.vcxproj b/Prometheus/samples/MetricsSample/MetricsSample_vs150.vcxproj new file mode 100644 index 000000000..b13b45f66 --- /dev/null +++ b/Prometheus/samples/MetricsSample/MetricsSample_vs150.vcxproj @@ -0,0 +1,607 @@ + + + + + debug_shared + Win32 + + + debug_shared + x64 + + + debug_static_md + Win32 + + + debug_static_md + x64 + + + debug_static_mt + Win32 + + + debug_static_mt + x64 + + + release_shared + Win32 + + + release_shared + x64 + + + release_static_md + Win32 + + + release_static_md + x64 + + + release_static_mt + Win32 + + + release_static_mt + x64 + + + + MetricsSample + {D256BB4C-7287-3E74-BC1A-31E116A8CE36} + MetricsSample + Win32Proj + + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>15.0.28307.799 + MetricsSampled + MetricsSampled + MetricsSampled + MetricsSample + MetricsSample + MetricsSample + MetricsSampled + MetricsSampled + MetricsSampled + MetricsSample + MetricsSample + MetricsSample + + + bin\ + obj\MetricsSample\$(Configuration)\ + true + + + bin\ + obj\MetricsSample\$(Configuration)\ + false + + + bin\static_mt\ + obj\MetricsSample\$(Configuration)\ + true + + + bin\static_mt\ + obj\MetricsSample\$(Configuration)\ + false + + + bin\static_md\ + obj\MetricsSample\$(Configuration)\ + true + + + bin\static_md\ + obj\MetricsSample\$(Configuration)\ + false + + + bin64\ + obj64\MetricsSample\$(Configuration)\ + true + + + bin64\ + obj64\MetricsSample\$(Configuration)\ + false + + + bin64\static_mt\ + obj64\MetricsSample\$(Configuration)\ + true + + + bin64\static_mt\ + obj64\MetricsSample\$(Configuration)\ + false + + + bin64\static_md\ + obj64\MetricsSample\$(Configuration)\ + true + + + bin64\static_md\ + obj64\MetricsSample\$(Configuration)\ + false + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\MetricsSampled.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\MetricsSampled.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\MetricsSample.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\static_mt\MetricsSampled.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\static_mt\MetricsSampled.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\static_mt\MetricsSample.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\static_md\MetricsSampled.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\static_md\MetricsSampled.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\static_md\MetricsSample.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\MetricsSampled.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\MetricsSampled.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\MetricsSample.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\static_mt\MetricsSampled.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\static_mt\MetricsSampled.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\static_mt\MetricsSample.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\static_md\MetricsSampled.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\static_md\MetricsSampled.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\static_md\MetricsSample.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + true + + + + + diff --git a/Prometheus/samples/MetricsSample/MetricsSample_vs150.vcxproj.filters b/Prometheus/samples/MetricsSample/MetricsSample_vs150.vcxproj.filters new file mode 100644 index 000000000..acf00fb88 --- /dev/null +++ b/Prometheus/samples/MetricsSample/MetricsSample_vs150.vcxproj.filters @@ -0,0 +1,13 @@ + + + + + {07345d00-18f9-4eb0-a7e8-5d3ff8ccdcad} + + + + + Source Files + + + \ No newline at end of file diff --git a/Prometheus/samples/MetricsSample/MetricsSample_vs160.vcxproj b/Prometheus/samples/MetricsSample/MetricsSample_vs160.vcxproj new file mode 100644 index 000000000..3cabed807 --- /dev/null +++ b/Prometheus/samples/MetricsSample/MetricsSample_vs160.vcxproj @@ -0,0 +1,607 @@ + + + + + debug_shared + Win32 + + + debug_shared + x64 + + + debug_static_md + Win32 + + + debug_static_md + x64 + + + debug_static_mt + Win32 + + + debug_static_mt + x64 + + + release_shared + Win32 + + + release_shared + x64 + + + release_static_md + Win32 + + + release_static_md + x64 + + + release_static_mt + Win32 + + + release_static_mt + x64 + + + + MetricsSample + {D256BB4C-7287-3E74-BC1A-31E116A8CE36} + MetricsSample + Win32Proj + + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>15.0.28307.799 + MetricsSampled + MetricsSampled + MetricsSampled + MetricsSample + MetricsSample + MetricsSample + MetricsSampled + MetricsSampled + MetricsSampled + MetricsSample + MetricsSample + MetricsSample + + + bin\ + obj\MetricsSample\$(Configuration)\ + true + + + bin\ + obj\MetricsSample\$(Configuration)\ + false + + + bin\static_mt\ + obj\MetricsSample\$(Configuration)\ + true + + + bin\static_mt\ + obj\MetricsSample\$(Configuration)\ + false + + + bin\static_md\ + obj\MetricsSample\$(Configuration)\ + true + + + bin\static_md\ + obj\MetricsSample\$(Configuration)\ + false + + + bin64\ + obj64\MetricsSample\$(Configuration)\ + true + + + bin64\ + obj64\MetricsSample\$(Configuration)\ + false + + + bin64\static_mt\ + obj64\MetricsSample\$(Configuration)\ + true + + + bin64\static_mt\ + obj64\MetricsSample\$(Configuration)\ + false + + + bin64\static_md\ + obj64\MetricsSample\$(Configuration)\ + true + + + bin64\static_md\ + obj64\MetricsSample\$(Configuration)\ + false + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\MetricsSampled.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\MetricsSampled.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\MetricsSample.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\static_mt\MetricsSampled.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\static_mt\MetricsSampled.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\static_mt\MetricsSample.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\static_md\MetricsSampled.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\static_md\MetricsSampled.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\static_md\MetricsSample.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\MetricsSampled.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\MetricsSampled.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\MetricsSample.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\static_mt\MetricsSampled.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\static_mt\MetricsSampled.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\static_mt\MetricsSample.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\static_md\MetricsSampled.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\static_md\MetricsSampled.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\static_md\MetricsSample.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + true + + + + + diff --git a/Prometheus/samples/MetricsSample/MetricsSample_vs160.vcxproj.filters b/Prometheus/samples/MetricsSample/MetricsSample_vs160.vcxproj.filters new file mode 100644 index 000000000..8ebc73526 --- /dev/null +++ b/Prometheus/samples/MetricsSample/MetricsSample_vs160.vcxproj.filters @@ -0,0 +1,13 @@ + + + + + {4c4ad498-7925-4d71-bfc9-00925f826ceb} + + + + + Source Files + + + \ No newline at end of file diff --git a/Prometheus/samples/MetricsSample/MetricsSample_vs170.vcxproj b/Prometheus/samples/MetricsSample/MetricsSample_vs170.vcxproj new file mode 100644 index 000000000..4df8c61a3 --- /dev/null +++ b/Prometheus/samples/MetricsSample/MetricsSample_vs170.vcxproj @@ -0,0 +1,607 @@ + + + + + debug_shared + Win32 + + + debug_shared + x64 + + + debug_static_md + Win32 + + + debug_static_md + x64 + + + debug_static_mt + Win32 + + + debug_static_mt + x64 + + + release_shared + Win32 + + + release_shared + x64 + + + release_static_md + Win32 + + + release_static_md + x64 + + + release_static_mt + Win32 + + + release_static_mt + x64 + + + + MetricsSample + {D256BB4C-7287-3E74-BC1A-31E116A8CE36} + MetricsSample + Win32Proj + + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>15.0.28307.799 + MetricsSampled + MetricsSampled + MetricsSampled + MetricsSample + MetricsSample + MetricsSample + MetricsSampled + MetricsSampled + MetricsSampled + MetricsSample + MetricsSample + MetricsSample + + + bin\ + obj\MetricsSample\$(Configuration)\ + true + + + bin\ + obj\MetricsSample\$(Configuration)\ + false + + + bin\static_mt\ + obj\MetricsSample\$(Configuration)\ + true + + + bin\static_mt\ + obj\MetricsSample\$(Configuration)\ + false + + + bin\static_md\ + obj\MetricsSample\$(Configuration)\ + true + + + bin\static_md\ + obj\MetricsSample\$(Configuration)\ + false + + + bin64\ + obj64\MetricsSample\$(Configuration)\ + true + + + bin64\ + obj64\MetricsSample\$(Configuration)\ + false + + + bin64\static_mt\ + obj64\MetricsSample\$(Configuration)\ + true + + + bin64\static_mt\ + obj64\MetricsSample\$(Configuration)\ + false + + + bin64\static_md\ + obj64\MetricsSample\$(Configuration)\ + true + + + bin64\static_md\ + obj64\MetricsSample\$(Configuration)\ + false + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\MetricsSampled.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\MetricsSampled.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\MetricsSample.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\static_mt\MetricsSampled.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\static_mt\MetricsSampled.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\static_mt\MetricsSample.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\static_md\MetricsSampled.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\static_md\MetricsSampled.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin\static_md\MetricsSample.exe + ..\..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\MetricsSampled.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\MetricsSampled.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\MetricsSample.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\static_mt\MetricsSampled.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\static_mt\MetricsSampled.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\static_mt\MetricsSample.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + Disabled + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\static_md\MetricsSampled.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\static_md\MetricsSampled.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + .\include;..\..\..\Foundation\include;..\..\..\Util\include;..\..\..\XML\include;..\..\..\JSON\include;..\..\..\Net\include;..\..\..\Prometheus\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + iphlpapi.lib;winmm.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies) + bin64\static_md\MetricsSample.exe + ..\..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + true + + + + + diff --git a/Prometheus/samples/MetricsSample/MetricsSample_vs170.vcxproj.filters b/Prometheus/samples/MetricsSample/MetricsSample_vs170.vcxproj.filters new file mode 100644 index 000000000..7f56be971 --- /dev/null +++ b/Prometheus/samples/MetricsSample/MetricsSample_vs170.vcxproj.filters @@ -0,0 +1,13 @@ + + + + + {31d254ca-b41c-447d-97f8-271ae656c427} + + + + + Source Files + + + \ No newline at end of file diff --git a/Prometheus/samples/MetricsSample/MetricsSample_vs90.vcproj b/Prometheus/samples/MetricsSample/MetricsSample_vs90.vcproj new file mode 100644 index 000000000..481def335 --- /dev/null +++ b/Prometheus/samples/MetricsSample/MetricsSample_vs90.vcproj @@ -0,0 +1,445 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Prometheus/samples/MetricsSample/src/MetricsSample.cpp b/Prometheus/samples/MetricsSample/src/MetricsSample.cpp new file mode 100644 index 000000000..b17f9f3e1 --- /dev/null +++ b/Prometheus/samples/MetricsSample/src/MetricsSample.cpp @@ -0,0 +1,95 @@ +#include "Poco/Prometheus/Counter.h" +#include "Poco/Prometheus/Gauge.h" +#include "Poco/Prometheus/Histogram.h" +#include "Poco/Prometheus/CallbackMetric.h" +#include "Poco/Prometheus/ProcessCollector.h" +#include "Poco/Prometheus/ThreadPoolCollector.h" +#include "Poco/Prometheus/MetricsServer.h" +#include "Poco/Util/ServerApplication.h" +#include +#include + + +using Poco::Util::ServerApplication; +using namespace std::string_literals; +using namespace Poco::Prometheus; + + +class MetricsSampleApp: public ServerApplication +{ +protected: + void initialize(Application& self) + { + loadConfiguration(); // load default configuration files, if present + ServerApplication::initialize(self); + } + + int main(const ArgVec& args) + { + try + { + Counter counter1("test_counter"s); + counter1.help("A test counter"s); + + counter1.inc(); + + Counter counter2("http_requests"s, { + /*.help = */"HTTP requests, grouped by method"s, + /*.labelNames =*/ {"method"s} + }); + + counter2.labels({"POST"s}).inc(); + counter2.labels({"GET"s}).inc(); + + Counter counter3("http_requests_uri"s, { + /*.help =*/ "HTTP requests, grouped by method and uri"s, + /*.labelNames =*/ {"method"s, "path"s} + }); + + counter3.labels({"POST"s, "/metrics"}).inc(3); + counter3.labels({"GET"s, "/test"s}).inc(); + + CallbackIntCounter counter4("callback_int"s, []() + { + return 42; + } + ); + + Gauge gauge1("sample_count"s); + gauge1.help("A sample gauge"s); + gauge1.set(-INFINITY); + + Histogram histo("sample_histogram"s, { + /*.help =*/ "A histogram"s, + /*.labelNames =*/ {}, + /*.buckets =*/ {1.0, 2.0, 3.0} + }); + + histo.observe(0.5); + histo.observe(1.1); + histo.observe(5.0); + histo.observe(2.1); + + ProcessCollector pc; + ThreadPoolCollector tpc; + + const Poco::UInt16 metricsPort = static_cast(config().getInt("metrics.port"s, 9100)); + MetricsServer server(metricsPort); + server.start(); + + waitForTerminationRequest(); + + server.stop(); + } + catch (Poco::Exception& exc) + { + std::cerr << exc.displayText() << std::endl; + return Application::EXIT_SOFTWARE; + } + + return Application::EXIT_OK; + } +}; + + +POCO_SERVER_MAIN(MetricsSampleApp) diff --git a/Prometheus/samples/dependencies b/Prometheus/samples/dependencies new file mode 100644 index 000000000..310d9fa18 --- /dev/null +++ b/Prometheus/samples/dependencies @@ -0,0 +1,5 @@ +Foundation +XML +Util +Net +Prometheus diff --git a/Prometheus/samples/samples_vs140.sln b/Prometheus/samples/samples_vs140.sln new file mode 100644 index 000000000..4b0c57572 --- /dev/null +++ b/Prometheus/samples/samples_vs140.sln @@ -0,0 +1,61 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MetricsSample", "MetricsSample\MetricsSample_vs140.vcxproj", "{D256BB4C-7287-3E74-BC1A-31E116A8CE36}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + debug_shared|Win32 = debug_shared|Win32 + release_shared|Win32 = release_shared|Win32 + debug_static_mt|Win32 = debug_static_mt|Win32 + release_static_mt|Win32 = release_static_mt|Win32 + debug_static_md|Win32 = debug_static_md|Win32 + release_static_md|Win32 = release_static_md|Win32 + debug_shared|x64 = debug_shared|x64 + release_shared|x64 = release_shared|x64 + debug_static_mt|x64 = debug_static_mt|x64 + release_static_mt|x64 = release_static_mt|x64 + debug_static_md|x64 = debug_static_md|x64 + release_static_md|x64 = release_static_md|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|Win32.ActiveCfg = debug_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|Win32.Build.0 = debug_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|Win32.Deploy.0 = debug_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|Win32.ActiveCfg = release_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|Win32.Build.0 = release_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|Win32.Deploy.0 = release_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|Win32.Build.0 = release_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|Win32.Build.0 = debug_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|Win32.ActiveCfg = release_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|Win32.Build.0 = release_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|Win32.Deploy.0 = release_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|x64.ActiveCfg = debug_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|x64.Build.0 = debug_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|x64.Deploy.0 = debug_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|x64.ActiveCfg = release_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|x64.Build.0 = release_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|x64.Deploy.0 = release_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|x64.Build.0 = debug_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|x64.Deploy.0 = debug_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|x64.ActiveCfg = release_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|x64.Build.0 = release_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|x64.Deploy.0 = release_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|x64.ActiveCfg = debug_static_md|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|x64.Build.0 = debug_static_md|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|x64.Deploy.0 = debug_static_md|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|x64.ActiveCfg = release_static_md|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|x64.Build.0 = release_static_md|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|x64.Deploy.0 = release_static_md|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Prometheus/samples/samples_vs150.sln b/Prometheus/samples/samples_vs150.sln new file mode 100644 index 000000000..81fb84bde --- /dev/null +++ b/Prometheus/samples/samples_vs150.sln @@ -0,0 +1,61 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MetricsSample", "MetricsSample\MetricsSample_vs150.vcxproj", "{D256BB4C-7287-3E74-BC1A-31E116A8CE36}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + debug_shared|Win32 = debug_shared|Win32 + release_shared|Win32 = release_shared|Win32 + debug_static_mt|Win32 = debug_static_mt|Win32 + release_static_mt|Win32 = release_static_mt|Win32 + debug_static_md|Win32 = debug_static_md|Win32 + release_static_md|Win32 = release_static_md|Win32 + debug_shared|x64 = debug_shared|x64 + release_shared|x64 = release_shared|x64 + debug_static_mt|x64 = debug_static_mt|x64 + release_static_mt|x64 = release_static_mt|x64 + debug_static_md|x64 = debug_static_md|x64 + release_static_md|x64 = release_static_md|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|Win32.ActiveCfg = debug_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|Win32.Build.0 = debug_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|Win32.Deploy.0 = debug_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|Win32.ActiveCfg = release_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|Win32.Build.0 = release_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|Win32.Deploy.0 = release_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|Win32.Build.0 = release_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|Win32.Build.0 = debug_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|Win32.ActiveCfg = release_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|Win32.Build.0 = release_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|Win32.Deploy.0 = release_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|x64.ActiveCfg = debug_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|x64.Build.0 = debug_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|x64.Deploy.0 = debug_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|x64.ActiveCfg = release_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|x64.Build.0 = release_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|x64.Deploy.0 = release_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|x64.Build.0 = debug_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|x64.Deploy.0 = debug_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|x64.ActiveCfg = release_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|x64.Build.0 = release_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|x64.Deploy.0 = release_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|x64.ActiveCfg = debug_static_md|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|x64.Build.0 = debug_static_md|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|x64.Deploy.0 = debug_static_md|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|x64.ActiveCfg = release_static_md|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|x64.Build.0 = release_static_md|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|x64.Deploy.0 = release_static_md|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Prometheus/samples/samples_vs160.sln b/Prometheus/samples/samples_vs160.sln new file mode 100644 index 000000000..ec69463a8 --- /dev/null +++ b/Prometheus/samples/samples_vs160.sln @@ -0,0 +1,61 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MetricsSample", "MetricsSample\MetricsSample_vs160.vcxproj", "{D256BB4C-7287-3E74-BC1A-31E116A8CE36}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + debug_shared|Win32 = debug_shared|Win32 + release_shared|Win32 = release_shared|Win32 + debug_static_mt|Win32 = debug_static_mt|Win32 + release_static_mt|Win32 = release_static_mt|Win32 + debug_static_md|Win32 = debug_static_md|Win32 + release_static_md|Win32 = release_static_md|Win32 + debug_shared|x64 = debug_shared|x64 + release_shared|x64 = release_shared|x64 + debug_static_mt|x64 = debug_static_mt|x64 + release_static_mt|x64 = release_static_mt|x64 + debug_static_md|x64 = debug_static_md|x64 + release_static_md|x64 = release_static_md|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|Win32.ActiveCfg = debug_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|Win32.Build.0 = debug_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|Win32.Deploy.0 = debug_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|Win32.ActiveCfg = release_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|Win32.Build.0 = release_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|Win32.Deploy.0 = release_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|Win32.Build.0 = release_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|Win32.Build.0 = debug_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|Win32.ActiveCfg = release_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|Win32.Build.0 = release_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|Win32.Deploy.0 = release_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|x64.ActiveCfg = debug_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|x64.Build.0 = debug_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|x64.Deploy.0 = debug_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|x64.ActiveCfg = release_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|x64.Build.0 = release_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|x64.Deploy.0 = release_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|x64.Build.0 = debug_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|x64.Deploy.0 = debug_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|x64.ActiveCfg = release_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|x64.Build.0 = release_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|x64.Deploy.0 = release_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|x64.ActiveCfg = debug_static_md|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|x64.Build.0 = debug_static_md|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|x64.Deploy.0 = debug_static_md|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|x64.ActiveCfg = release_static_md|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|x64.Build.0 = release_static_md|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|x64.Deploy.0 = release_static_md|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Prometheus/samples/samples_vs170.sln b/Prometheus/samples/samples_vs170.sln new file mode 100644 index 000000000..2dfa8955c --- /dev/null +++ b/Prometheus/samples/samples_vs170.sln @@ -0,0 +1,61 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MetricsSample", "MetricsSample\MetricsSample_vs170.vcxproj", "{D256BB4C-7287-3E74-BC1A-31E116A8CE36}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + debug_shared|Win32 = debug_shared|Win32 + release_shared|Win32 = release_shared|Win32 + debug_static_mt|Win32 = debug_static_mt|Win32 + release_static_mt|Win32 = release_static_mt|Win32 + debug_static_md|Win32 = debug_static_md|Win32 + release_static_md|Win32 = release_static_md|Win32 + debug_shared|x64 = debug_shared|x64 + release_shared|x64 = release_shared|x64 + debug_static_mt|x64 = debug_static_mt|x64 + release_static_mt|x64 = release_static_mt|x64 + debug_static_md|x64 = debug_static_md|x64 + release_static_md|x64 = release_static_md|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|Win32.ActiveCfg = debug_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|Win32.Build.0 = debug_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|Win32.Deploy.0 = debug_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|Win32.ActiveCfg = release_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|Win32.Build.0 = release_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|Win32.Deploy.0 = release_shared|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|Win32.Build.0 = release_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|Win32.Build.0 = debug_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|Win32.ActiveCfg = release_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|Win32.Build.0 = release_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|Win32.Deploy.0 = release_static_md|Win32 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|x64.ActiveCfg = debug_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|x64.Build.0 = debug_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_shared|x64.Deploy.0 = debug_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|x64.ActiveCfg = release_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|x64.Build.0 = release_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_shared|x64.Deploy.0 = release_shared|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|x64.Build.0 = debug_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_mt|x64.Deploy.0 = debug_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|x64.ActiveCfg = release_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|x64.Build.0 = release_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_mt|x64.Deploy.0 = release_static_mt|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|x64.ActiveCfg = debug_static_md|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|x64.Build.0 = debug_static_md|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.debug_static_md|x64.Deploy.0 = debug_static_md|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|x64.ActiveCfg = release_static_md|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|x64.Build.0 = release_static_md|x64 + {D256BB4C-7287-3E74-BC1A-31E116A8CE36}.release_static_md|x64.Deploy.0 = release_static_md|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Prometheus/src/Collector.cpp b/Prometheus/src/Collector.cpp new file mode 100644 index 000000000..d067abce9 --- /dev/null +++ b/Prometheus/src/Collector.cpp @@ -0,0 +1,37 @@ +// +// Collector.cpp +// +// Library: Prometheus +// Package: Core +// Module: Collector +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/Prometheus/Collector.h" +#include "Poco/RegularExpression.h" +#include "Poco/Exception.h" + + +using namespace std::string_literals; + + +namespace Poco { +namespace Prometheus { + + +const std::string& Collector::validateName(const std::string& name) +{ + static Poco::RegularExpression nameExpr{"^[a-zA-Z_:][a-zA-Z0-9_:]*$"s}; + + if (!nameExpr.match(name)) throw Poco::SyntaxException("Not a valid collector or metric name"s, name); + + return name; +} + + +} } // namespace Poco::Prometheus diff --git a/Prometheus/src/Counter.cpp b/Prometheus/src/Counter.cpp new file mode 100644 index 000000000..cfe89af54 --- /dev/null +++ b/Prometheus/src/Counter.cpp @@ -0,0 +1,82 @@ +// +// Counter.cpp +// +// Library: Prometheus +// Package: Core +// Module: Counter +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/Prometheus/Counter.h" + + +namespace Poco { +namespace Prometheus { + + +Counter::Counter(const std::string& name): + LabeledMetricImpl(Metric::Type::COUNTER, name) +{ +} + + +Counter::Counter(const std::string& name, const Params& params): + LabeledMetricImpl(Metric::Type::COUNTER, name) +{ + setHelp(params.help); + setLabelNames(params.labelNames); +} + + +Counter::Counter(const std::string& name, Registry* pRegistry): + LabeledMetricImpl(Metric::Type::COUNTER, name, pRegistry) +{ +} + + +Counter::Counter(const std::string& name, const Params& params, Registry* pRegistry): + LabeledMetricImpl(Metric::Type::COUNTER, name, pRegistry) +{ + setHelp(params.help); + setLabelNames(params.labelNames); +} + + +double Counter::value() const +{ + return _sample.value(); +} + + +void Counter::exportTo(Exporter& exporter) const +{ + if (labelNames().empty()) + { + exporter.writeHeader(*this); + exporter.writeSample(*this, {}, {}, _sample.value(), _sample.timestamp()); + } + else + { + LabeledMetricImpl::exportTo(exporter); + } +} + + +std::unique_ptr Counter::createSample() const +{ + return std::make_unique(); +} + + +void Counter::writeSample(Exporter& exporter, const std::vector& labelValues, const CounterSample& sample) const +{ + exporter.writeSample(*this, labelNames(), labelValues, sample.value(), sample.timestamp()); +} + + +} } // namespace Poco::Prometheus diff --git a/Prometheus/src/Gauge.cpp b/Prometheus/src/Gauge.cpp new file mode 100644 index 000000000..4a20f1a87 --- /dev/null +++ b/Prometheus/src/Gauge.cpp @@ -0,0 +1,82 @@ +// +// Gauge.cpp +// +// Library: Prometheus +// Package: Core +// Module: Gauge +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/Prometheus/Gauge.h" + + +namespace Poco { +namespace Prometheus { + + +Gauge::Gauge(const std::string& name): + LabeledMetricImpl(Metric::Type::GAUGE, name) +{ +} + + +Gauge::Gauge(const std::string& name, const Params& params): + LabeledMetricImpl(Metric::Type::GAUGE, name) +{ + setHelp(params.help); + setLabelNames(params.labelNames); +} + + +Gauge::Gauge(const std::string& name, Registry* pRegistry): + LabeledMetricImpl(Metric::Type::GAUGE, name, pRegistry) +{ +} + + +Gauge::Gauge(const std::string& name, const Params& params, Registry* pRegistry): + LabeledMetricImpl(Metric::Type::GAUGE, name, pRegistry) +{ + setHelp(params.help); + setLabelNames(params.labelNames); +} + + +double Gauge::value() const +{ + return _sample.value(); +} + + +void Gauge::exportTo(Exporter& exporter) const +{ + if (labelNames().empty()) + { + exporter.writeHeader(*this); + exporter.writeSample(*this, {}, {}, _sample.value(), _sample.timestamp()); + } + else + { + LabeledMetricImpl::exportTo(exporter); + } +} + + +std::unique_ptr Gauge::createSample() const +{ + return std::make_unique(); +} + + +void Gauge::writeSample(Exporter& exporter, const std::vector& labelValues, const GaugeSample& sample) const +{ + exporter.writeSample(*this, labelNames(), labelValues, sample.value(), sample.timestamp()); +} + + +} } // namespace Poco::Prometheus diff --git a/Prometheus/src/Histogram.cpp b/Prometheus/src/Histogram.cpp new file mode 100644 index 000000000..5e76a8ba7 --- /dev/null +++ b/Prometheus/src/Histogram.cpp @@ -0,0 +1,151 @@ +// +// Histogram.cpp +// +// Library: Prometheus +// Package: Core +// Module: Histogram +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/Prometheus/Histogram.h" +#include "Poco/Prometheus/Gauge.h" +#include "Poco/Prometheus/Exporter.h" +#include "Poco/NumberFormatter.h" + +using namespace std::string_literals; + + +namespace Poco { +namespace Prometheus { + + +HistogramSample::HistogramSample(const std::vector& bucketBounds): + _bucketBounds(bucketBounds), + _bucketCounts(bucketBounds.size(), 0) +{ +} + + +void HistogramSample::observe(double value) +{ + Poco::FastMutex::ScopedLock lock(_mutex); + + const std::size_t n = _bucketBounds.size(); + for (std::size_t i = 0; i < n; i++) + { + if (value <= _bucketBounds[i]) + { + _bucketCounts[i]++; + } + } + _sum += value; + _count++; +} + + +void HistogramSample::observe(Poco::Clock::ClockVal v) +{ + observe(double(v)/Poco::Clock::resolution()); +} + + +Histogram::Histogram(const std::string& name): + LabeledMetricImpl(Metric::Type::HISTOGRAM, name) +{ +} + + +Histogram::Histogram(const std::string& name, const Params& params): + LabeledMetricImpl(Metric::Type::HISTOGRAM, name), + _bucketBounds(params.buckets) +{ + setHelp(params.help); + setLabelNames(params.labelNames); +} + + +Histogram::Histogram(const std::string& name, Registry* pRegistry): + LabeledMetricImpl(Metric::Type::HISTOGRAM, name, pRegistry) +{ +} + + +Histogram::Histogram(const std::string& name, const Params& params, Registry* pRegistry): + LabeledMetricImpl(Metric::Type::HISTOGRAM, name, pRegistry), + _bucketBounds(params.buckets) +{ + setHelp(params.help); + setLabelNames(params.labelNames); +} + + +Histogram& Histogram::buckets(const std::vector& bucketBounds) +{ + _bucketBounds = bucketBounds; + return *this; +} + + +void Histogram::observe(double value) +{ + labels(EMPTY_LABEL).observe(value); +} + + +void Histogram::observe(Poco::Clock::ClockVal v) +{ + labels(EMPTY_LABEL).observe(double(v)/Poco::Clock::resolution()); +} + + +HistogramData Histogram::data() const +{ + return labels(EMPTY_LABEL).data(); +} + + +std::unique_ptr Histogram::createSample() const +{ + return std::make_unique(_bucketBounds); +} + + +void Histogram::exportTo(Exporter& exporter) const +{ + Poco::FastMutex::ScopedLock lock(_mutex); + + Gauge bucket(name() + "_bucket"s, nullptr); + Gauge sum(name() + "_sum"s, nullptr); + Gauge count(name() + "_count"s, nullptr); + + exporter.writeHeader(*this); + std::vector bucketLabels = labelNames(); + bucketLabels.push_back("le"s); + const std::size_t n = _bucketBounds.size(); + forEach( + [&](const std::vector& labelValues, const HistogramSample& sample) + { + std::vector bucketLabelValues = labelValues; + bucketLabelValues.push_back(""s); + const HistogramData data = sample.data(); + for (std::size_t i = 0; i < n; i++) + { + bucketLabelValues.back() = Poco::NumberFormatter::format(_bucketBounds[i]); + + exporter.writeSample(bucket, bucketLabels, bucketLabelValues, data.bucketCounts[i]); + } + bucketLabelValues.back() = "+Inf"s; + exporter.writeSample(bucket, bucketLabels, bucketLabelValues, data.count); + exporter.writeSample(sum, labelNames(), labelValues, data.sum); + exporter.writeSample(count, labelNames(), labelValues, data.count); + } + ); +} + + +} } // namespace Poco::Prometheus diff --git a/Prometheus/src/IntCounter.cpp b/Prometheus/src/IntCounter.cpp new file mode 100644 index 000000000..71eeb523c --- /dev/null +++ b/Prometheus/src/IntCounter.cpp @@ -0,0 +1,33 @@ +// +// IntCounter.cpp +// +// Library: Prometheus +// Package: Core +// Module: IntCounter +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/Prometheus/IntCounter.h" +#include "Poco/Prometheus/Exporter.h" +#include + + +namespace Poco { +namespace Prometheus { + + +void IntCounter::exportTo(Exporter& exporter) const +{ + const std::vector EMPTY_VEC; + + exporter.writeHeader(*this); + exporter.writeSample(*this, EMPTY_VEC, EMPTY_VEC, _value, 0); +} + + +} } // namespace Poco::Prometheus diff --git a/Prometheus/src/IntGauge.cpp b/Prometheus/src/IntGauge.cpp new file mode 100644 index 000000000..efc8a5f8b --- /dev/null +++ b/Prometheus/src/IntGauge.cpp @@ -0,0 +1,33 @@ +// +// IntGauge.cpp +// +// Library: Prometheus +// Package: Core +// Module: IntGauge +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/Prometheus/IntGauge.h" +#include "Poco/Prometheus/Exporter.h" +#include + + +namespace Poco { +namespace Prometheus { + + +void IntGauge::exportTo(Exporter& exporter) const +{ + const std::vector EMPTY_VEC; + + exporter.writeHeader(*this); + exporter.writeSample(*this, EMPTY_VEC, EMPTY_VEC, _value, 0); +} + + +} } // namespace Poco::Prometheus diff --git a/Prometheus/src/LabeledMetric.cpp b/Prometheus/src/LabeledMetric.cpp new file mode 100644 index 000000000..9ffc2bb0b --- /dev/null +++ b/Prometheus/src/LabeledMetric.cpp @@ -0,0 +1,52 @@ +// +// LabeledMetric.cpp +// +// Library: Prometheus +// Package: Core +// Module: LabeledMetric +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/Prometheus/LabeledMetric.h" +#include "Poco/RegularExpression.h" +#include "Poco/Exception.h" + + +using namespace std::string_literals; + + +namespace Poco { +namespace Prometheus { + + +const std::vector LabeledMetric::EMPTY_LABEL; + + +const std::string& LabeledMetric::validateLabelName(const std::string& name) +{ + static Poco::RegularExpression nameExpr{"^[a-zA-Z0-9_]*$"s}; + + if (!nameExpr.match(name)) throw Poco::SyntaxException("Not a valid label name"s, name); + + return name; +} + + +void LabeledMetric::setLabelNames(const std::vector& labelNames) +{ + if (!_labelNames.empty()) throw Poco::IllegalStateException("Label names have already been set for metric"s, name()); + + _labelNames.reserve(labelNames.size()); + for (const auto& labelName: labelNames) + { + _labelNames.push_back(validateLabelName(labelName)); + } +} + + +} } // namespace Poco::Prometheus diff --git a/Prometheus/src/MetricsRequestHandler.cpp b/Prometheus/src/MetricsRequestHandler.cpp new file mode 100644 index 000000000..c0f2fca03 --- /dev/null +++ b/Prometheus/src/MetricsRequestHandler.cpp @@ -0,0 +1,69 @@ +// +// MetricsRequestHandler.cpp +// +// Library: Prometheus +// Package: HTTP +// Module: MetricsRequestHandler +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/Prometheus/MetricsRequestHandler.h" +#include "Poco/Prometheus/Registry.h" +#include "Poco/Prometheus/TextExporter.h" +#include "Poco/Net/HTTPServerRequest.h" +#include "Poco/Net/HTTPServerResponse.h" +#include "Poco/DeflatingStream.h" + + +using namespace std::string_literals; + + +namespace Poco { +namespace Prometheus { + + +MetricsRequestHandler::MetricsRequestHandler(): + _registry(Registry::defaultRegistry()) +{ +} + + +MetricsRequestHandler::MetricsRequestHandler(const Registry& registry): + _registry(registry) +{ +} + + +void MetricsRequestHandler::handleRequest(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response) +{ + if (request.getMethod() == Poco::Net::HTTPRequest::HTTP_GET || request.getMethod() == Poco::Net::HTTPRequest::HTTP_HEAD) + { + response.setChunkedTransferEncoding(true); + response.setContentType("text/plain; version=0.0.4"s); + bool compressResponse(request.hasToken("Accept-Encoding"s, "gzip"s)); + if (compressResponse) response.set("Content-Encoding"s, "gzip"s); + response.set("Cache-Control"s, "no-cache, no-store"s); + std::ostream& plainResponseStream = response.send(); + if (request.getMethod() == Poco::Net::HTTPRequest::HTTP_GET) + { + Poco::DeflatingOutputStream gzipStream(plainResponseStream, Poco::DeflatingStreamBuf::STREAM_GZIP, 1); + std::ostream& responseStream = compressResponse ? gzipStream : plainResponseStream; + TextExporter exporter(responseStream); + _registry.exportTo(exporter); + } + } + else + { + response.setStatusAndReason(Poco::Net::HTTPResponse::HTTP_METHOD_NOT_ALLOWED); + response.setContentLength(0); + response.send(); + } +} + + +} } // namespace Poco::Prometheus diff --git a/Prometheus/src/MetricsServer.cpp b/Prometheus/src/MetricsServer.cpp new file mode 100644 index 000000000..36670cbd6 --- /dev/null +++ b/Prometheus/src/MetricsServer.cpp @@ -0,0 +1,118 @@ +// +// MetricsServer.cpp +// +// Library: Prometheus +// Package: HTTP +// Module: MetricsServer +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/Prometheus/MetricsServer.h" +#include "Poco/Prometheus/MetricsRequestHandler.h" +#include "Poco/Prometheus/Registry.h" +#include "Poco/Net/HTTPRequestHandlerFactory.h" +#include "Poco/Net/HTTPServerRequest.h" +#include "Poco/Net/HTTPServerResponse.h" + + +using namespace std::string_literals; + + +namespace Poco { +namespace Prometheus { + + +class NotFoundRequestHandler: public Poco::Net::HTTPRequestHandler +{ +public: + void handleRequest(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response) + { + response.setStatusAndReason(Poco::Net::HTTPResponse::HTTP_NOT_FOUND); + response.setChunkedTransferEncoding(true); + response.setContentType("text/html"s); + response.send() + << "" + << "404 - Not Found" + << "

Not Found

The requested resource was not found.

" + << ""; + } +}; + + +class MetricsRequestHandlerFactory: public Poco::Net::HTTPRequestHandlerFactory +{ +public: + MetricsRequestHandlerFactory(const Registry& registry, const std::string& path): + _registry(registry), + _path(path) + { + } + + Poco::Net::HTTPRequestHandler* createRequestHandler(const Poco::Net::HTTPServerRequest& request) + { + if (request.getURI() == _path) + { + return new MetricsRequestHandler(_registry); + } + else + { + return new NotFoundRequestHandler; + } + } + +private: + const Registry& _registry; + const std::string _path; +}; + + +const Poco::UInt16 MetricsServer::DEFAULT_PORT{9100}; +const std::string MetricsServer::DEFAULT_PATH{"/metrics"s}; + + +MetricsServer::MetricsServer(Poco::UInt16 port, const std::string& path): + _httpServer(new MetricsRequestHandlerFactory(Registry::defaultRegistry(), path), port, defaultParams()) +{ +} + + +MetricsServer::MetricsServer(const Registry& registry, Poco::UInt16 port, const std::string& path): + _httpServer(new MetricsRequestHandlerFactory(registry, path), port, defaultParams()) +{ +} + + +MetricsServer::MetricsServer(const Registry& registry, Poco::Net::ServerSocket& socket, Poco::Net::HTTPServerParams::Ptr pServerParams, const std::string& path): + _httpServer(new MetricsRequestHandlerFactory(registry, path), socket, pServerParams) +{ +} + + +void MetricsServer::start() +{ + _httpServer.start(); +} + + +void MetricsServer::stop() +{ + _httpServer.stopAll(); +} + + +Poco::Net::HTTPServerParams::Ptr MetricsServer::defaultParams() +{ + Poco::Net::HTTPServerParams::Ptr pParams = new Poco::Net::HTTPServerParams; + pParams->setMaxQueued(8); + pParams->setMaxThreads(2); + pParams->setKeepAlive(false); + return pParams; +} + + +} } // namespace Poco::Prometheus diff --git a/Prometheus/src/ProcessCollector.cpp b/Prometheus/src/ProcessCollector.cpp new file mode 100644 index 000000000..5c45a11db --- /dev/null +++ b/Prometheus/src/ProcessCollector.cpp @@ -0,0 +1,102 @@ +// +// ProcessCollector.cpp +// +// Library: Prometheus +// Package: Collectors +// Module: ProcessCollector +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/Prometheus/ProcessCollector.h" +#include "Poco/Process.h" +#ifdef POCO_OS_FAMILY_UNIX +#include +#include +#include +#endif + + +using namespace std::string_literals; + + +namespace Poco { +namespace Prometheus { + + +Poco::Timestamp ProcessCollector::_startTime; + + +ProcessCollector::ProcessCollector(): + Collector("process"s) +{ + buildMetrics(); +} + + +ProcessCollector::ProcessCollector(const std::string& name, Registry* pRegistry): + Collector(name, pRegistry) +{ + buildMetrics(); +} + + +void ProcessCollector::exportTo(Exporter& exporter) const +{ + for (const auto& p: _metrics) + { + p->exportTo(exporter); + } +} + + +void ProcessCollector::buildMetrics() +{ + _metrics.push_back(std::make_unique( + name() + "_cpu_seconds_total"s, + "Total user and system CPU time spent in seconds"s, + nullptr, + []() + { + long user; + long system; + Poco::Process::times(user, system); + return static_cast(user) + static_cast(system); + })); + +#ifdef POCO_OS_FAMILY_UNIX + _metrics.push_back(std::make_unique( + name() + "_max_fds"s, + "Maximum number of open file descriptors"s, + nullptr, + []() + { + return sysconf(_SC_OPEN_MAX); + })); +#endif + + _metrics.push_back(std::make_unique( + name() + "_start_time_seconds"s, + "Start time of the process since unix epoch in seconds"s, + nullptr, + []() + { + return static_cast(ProcessCollector::startTime().epochMicroseconds()/1000)/1000.0; + })); + + _metrics.push_back(std::make_unique( + name() + "_up_time_seconds"s, + "Time in seconds the process has been up and running"s, + nullptr, + []() + { + return static_cast(ProcessCollector::startTime().elapsed()/1000)/1000.0; + })); +} + + +} } // namespace Poco::Prometheus diff --git a/Prometheus/src/Registry.cpp b/Prometheus/src/Registry.cpp new file mode 100644 index 000000000..eff7b4c7c --- /dev/null +++ b/Prometheus/src/Registry.cpp @@ -0,0 +1,105 @@ +// +// Registry.cpp +// +// Library: Prometheus +// Package: Core +// Module: Registry +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/Prometheus/Registry.h" +#include "Poco/Prometheus/Collector.h" +#include "Poco/Exception.h" +#include "Poco/SingletonHolder.h" + + +using namespace std::string_literals; + + +namespace Poco { +namespace Prometheus { + + +void Registry::registerCollector(Collector* pCollector) +{ + poco_check_ptr (pCollector); + + Poco::FastMutex::ScopedLock lock(_mutex); + + const auto it = _collectors.find(pCollector->name()); + if (it == _collectors.end()) + { + _collectors[pCollector->name()] = pCollector; + } + else + { + throw Poco::ExistsException("collector"s, pCollector->name()); + } +} + + +void Registry::unregisterCollector(Collector* pCollector) +{ + poco_check_ptr (pCollector); + + unregisterCollector(pCollector->name()); +} + + +void Registry::unregisterCollector(const std::string& collectorName) +{ + Poco::FastMutex::ScopedLock lock(_mutex); + + _collectors.erase(collectorName); +} + + +Collector* Registry::findCollector(const std::string& collectorName) const +{ + Poco::FastMutex::ScopedLock lock(_mutex); + + const auto it = _collectors.find(collectorName); + if (it != _collectors.end()) + return it->second; + else + return nullptr; +} + + +void Registry::clear() +{ + Poco::FastMutex::ScopedLock lock(_mutex); + + _collectors.clear(); +} + + +void Registry::exportTo(Exporter& exporter) const +{ + Poco::FastMutex::ScopedLock lock(_mutex); + + for (const auto& p: _collectors) + { + p.second->exportTo(exporter); + } +} + + +namespace +{ + static SingletonHolder sh; +} + + +Registry& Registry::defaultRegistry() +{ + return *sh.get(); +} + + +} } // namespace Poco::Prometheus diff --git a/Prometheus/src/TextExporter.cpp b/Prometheus/src/TextExporter.cpp new file mode 100644 index 000000000..940530bb9 --- /dev/null +++ b/Prometheus/src/TextExporter.cpp @@ -0,0 +1,185 @@ +// +// TextExporter.cpp +// +// Library: Prometheus +// Package: Core +// Module: TextExporter +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/Prometheus/TextExporter.h" +#include "Poco/NumberFormatter.h" +#include +#include +#include + + +using namespace std::string_literals; + + +namespace Poco { +namespace Prometheus { + + +const std::string TextExporter::COUNTER{"counter"s}; +const std::string TextExporter::GAUGE{"gauge"s}; +const std::string TextExporter::HISTOGRAM{"histogram"s}; +const std::string TextExporter::SUMMARY{"summary"s}; +const std::string TextExporter::UNTYPED{"untyped"s}; + + +namespace +{ + std::string escape(const std::string& str) + { + std::string result; + for (char c: str) + { + switch (c) + { + case '\\': + result += "\\\\"; + break; + case '\n': + result += "\\n"; + break; + case '"': + result += "\\\""; + break; + default: + result += c; + } + } + return result; + } + + template + void writeSampleImpl(std::ostream& stream, const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, T&& value, const Poco::Timestamp& timestamp) + { + poco_assert_dbg (labelNames.size() == labelValues.size()); + + stream << metric.name(); + if (!labelNames.empty()) + { + stream << '{'; + for (std::size_t i = 0; i < labelNames.size(); i++) + { + if (i > 0) stream << ','; + stream << labelNames[i] << "=\"" << escape(labelValues[i]) << '"'; + } + stream << '}'; + } + stream << ' ' << value; + if (timestamp != 0) + { + stream << ' ' << timestamp.epochMicroseconds()/1000; + } + stream << '\n'; + } +} + + +TextExporter::TextExporter(std::ostream& ostr): + _stream(ostr) +{ +} + + +void TextExporter::writeHeader(const Metric& metric) +{ + const std::string& help = metric.help(); + const std::string& type = typeToString(metric.type()); + + if (!help.empty()) + { + _stream << "# HELP " << metric.name() << ' ' << help << '\n'; + } + _stream << "# TYPE " << metric.name() << ' ' << type << '\n'; +} + + +void TextExporter::writeSample(const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, float value, const Poco::Timestamp& timestamp) +{ + writeSample(metric, labelNames, labelValues, static_cast(value), timestamp); +} + + +void TextExporter::writeSample(const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, double value, const Poco::Timestamp& timestamp) +{ + std::string valueString; + if (std::isinf(value)) + { + if (value > 0) + valueString = "+Inf"; + else + valueString = "-Inf"; + } + else if (std::isnan(value)) + { + valueString = "NaN"; + } + else + { + valueString = Poco::NumberFormatter::format(value); + } + writeSampleImpl(_stream, metric, labelNames, labelValues, valueString, timestamp); +} + + +void TextExporter::writeSample(const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, Poco::UInt32 value, const Poco::Timestamp& timestamp) +{ + writeSampleImpl(_stream, metric, labelNames, labelValues, value, timestamp); +} + + +void TextExporter::writeSample(const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, Poco::Int32 value, const Poco::Timestamp& timestamp) +{ + writeSampleImpl(_stream, metric, labelNames, labelValues, value, timestamp); +} + + +void TextExporter::writeSample(const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, Poco::UInt64 value, const Poco::Timestamp& timestamp) +{ + writeSampleImpl(_stream, metric, labelNames, labelValues, value, timestamp); +} + + +void TextExporter::writeSample(const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, Poco::Int64 value, const Poco::Timestamp& timestamp) +{ + writeSampleImpl(_stream, metric, labelNames, labelValues, value, timestamp); +} + + +void TextExporter::writeSample(const Metric& metric, const std::vector& labelNames, const std::vector& labelValues, const std::string& value, const Poco::Timestamp& timestamp) +{ + writeSampleImpl(_stream, metric, labelNames, labelValues, value, timestamp); +} + + +const std::string& TextExporter::typeToString(Metric::Type type) +{ + switch (type) + { + case Metric::Type::COUNTER: + return COUNTER; + case Metric::Type::GAUGE: + return GAUGE; + case Metric::Type::HISTOGRAM: + return HISTOGRAM; + case Metric::Type::SUMMARY: + return SUMMARY; + case Metric::Type::UNTYPED: + return UNTYPED; + default: + poco_bugcheck(); + return UNTYPED; + } +} + + +} } // namespace Poco::Prometheus diff --git a/Prometheus/src/ThreadPoolCollector.cpp b/Prometheus/src/ThreadPoolCollector.cpp new file mode 100644 index 000000000..99dae1561 --- /dev/null +++ b/Prometheus/src/ThreadPoolCollector.cpp @@ -0,0 +1,120 @@ +// +// ThreadPoolCollector.cpp +// +// Library: Prometheus +// Package: Collectors +// Module: ThreadPoolCollector +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/Prometheus/ThreadPoolCollector.h" +#include "Poco/Ascii.h" + + +using namespace std::string_literals; + + +namespace Poco { +namespace Prometheus { + + +const std::string ThreadPoolCollector::NAME_PREFIX{"poco_threadpool"s}; + + +ThreadPoolCollector::ThreadPoolCollector(): + Collector(NAME_PREFIX), + _threadPoolName("default"s), + _threadPool(Poco::ThreadPool::defaultPool()) +{ + buildMetrics(); +} + + +ThreadPoolCollector::ThreadPoolCollector(const Poco::ThreadPool& threadPool): + Collector(collectorName(threadPool.name())), + _threadPoolName(threadPool.name()), + _threadPool(threadPool) +{ + buildMetrics(); +} + + +ThreadPoolCollector::ThreadPoolCollector(const std::string& name, const Poco::ThreadPool& threadPool, Registry* pRegistry): + Collector(collectorName(name), pRegistry), + _threadPoolName(name), + _threadPool(threadPool) +{ + buildMetrics(); +} + + +void ThreadPoolCollector::exportTo(Exporter& exporter) const +{ + const std::vector labelNames{"name"s}; + const std::vector labelValues{_threadPoolName}; + + for (const auto& p: _metrics) + { + exporter.writeHeader(*p); + exporter.writeSample(*p, labelNames, labelValues, p->value(), 0); + } +} + + +void ThreadPoolCollector::buildMetrics() +{ + const Poco::ThreadPool& threadPool = _threadPool; + + _metrics.push_back(std::make_unique( + NAME_PREFIX + "_max_threads"s, + "Maximum number of threads available in the thread pool (capacity)"s, + nullptr, + [&threadPool]() + { + return threadPool.capacity(); + })); + + _metrics.push_back(std::make_unique( + NAME_PREFIX + "_used_threads"s, + "Number of currently used threads"s, + nullptr, + [&threadPool]() + { + return threadPool.used(); + })); + + _metrics.push_back(std::make_unique( + NAME_PREFIX + "_allocated_threads"s, + "Number of currently allocated threads"s, + nullptr, + [&threadPool]() + { + return threadPool.allocated(); + })); +} + + +std::string ThreadPoolCollector::collectorName(const std::string& threadPoolName) +{ + std::string result(NAME_PREFIX); + if (!threadPoolName.empty()) + { + result += '_'; + for (const char c: threadPoolName) + { + if (Poco::Ascii::isAlphaNumeric(c) || c == '_') + result += c; + else + result += '_'; + } + } + return result; +} + + +} } // namespace Poco::Prometheus diff --git a/Prometheus/testsuite/CMakeLists.txt b/Prometheus/testsuite/CMakeLists.txt new file mode 100644 index 000000000..2d840a988 --- /dev/null +++ b/Prometheus/testsuite/CMakeLists.txt @@ -0,0 +1,31 @@ +# Sources +file(GLOB SRCS_G "src/*.cpp") +POCO_SOURCES_AUTO(TEST_SRCS ${SRCS_G}) + +# Headers +file(GLOB_RECURSE HDRS_G "src/*.h") +POCO_HEADERS_AUTO(TEST_SRCS ${HDRS_G}) + +POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF + src/WinDriver.cpp +) + +POCO_SOURCES_AUTO_PLAT(TEST_SRCS WINCE + src/WinCEDriver.cpp +) + +add_executable(Prometheus-testrunner ${TEST_SRCS}) +if(ANDROID) + add_test( + NAME Prometheus + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/Prometheus-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake + ) +else() + add_test( + NAME Prometheus + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Prometheus-testrunner -ignore ${CMAKE_SOURCE_DIR}/cppignore.lnx -all + ) + set_tests_properties(Prometheus PROPERTIES ENVIRONMENT POCO_BASE=${CMAKE_SOURCE_DIR}) +endif() +target_link_libraries(Prometheus-testrunner PUBLIC Poco::Prometheus CppUnit) diff --git a/Prometheus/testsuite/Makefile b/Prometheus/testsuite/Makefile new file mode 100644 index 000000000..77e023502 --- /dev/null +++ b/Prometheus/testsuite/Makefile @@ -0,0 +1,23 @@ +# +# Makefile +# +# Makefile for Poco Prometheus testsuite +# + +include $(POCO_BASE)/build/rules/global + +objects = \ + Driver \ + CounterTest \ + GaugeTest \ + IntCounterTest \ + IntGaugeTest \ + CallbackMetricTest \ + HistogramTest \ + PrometheusTestSuite + +target = testrunner +target_version = 1 +target_libs = PocoPrometheus PocoNet PocoFoundation CppUnit + +include $(POCO_BASE)/build/rules/exec diff --git a/Prometheus/testsuite/TestSuite.progen b/Prometheus/testsuite/TestSuite.progen new file mode 100644 index 000000000..4d498e045 --- /dev/null +++ b/Prometheus/testsuite/TestSuite.progen @@ -0,0 +1,9 @@ +vc.project.guid = 04B69538-1444-4A22-A98D-3C69CD7B44DA +vc.project.name = TestSuite +vc.project.target = TestSuite +vc.project.type = testsuite +vc.project.pocobase = ..\\.. +vc.project.platforms = Win32 +vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md +vc.project.prototype = TestSuite_vs90.vcproj +vc.project.compiler.include = ..\\..\\Foundation\\include;..\\..\\Net\\include;..\\..\\Prometheus\\include;.\\include diff --git a/Prometheus/testsuite/TestSuite_vs140.vcxproj b/Prometheus/testsuite/TestSuite_vs140.vcxproj new file mode 100644 index 000000000..afa41b45d --- /dev/null +++ b/Prometheus/testsuite/TestSuite_vs140.vcxproj @@ -0,0 +1,637 @@ + + + + + debug_shared + Win32 + + + debug_shared + x64 + + + debug_static_md + Win32 + + + debug_static_md + x64 + + + debug_static_mt + Win32 + + + debug_static_mt + x64 + + + release_shared + Win32 + + + release_shared + x64 + + + release_static_md + Win32 + + + release_static_md + x64 + + + release_static_mt + Win32 + + + release_static_mt + x64 + + + + TestSuite + {04B69538-1444-4A22-A98D-3C69CD7B44DA} + TestSuite + Win32Proj + + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>14.0.25420.1 + TestSuited + TestSuited + TestSuited + TestSuite + TestSuite + TestSuite + TestSuited + TestSuited + TestSuited + TestSuite + TestSuite + TestSuite + + + bin\ + obj\TestSuite\$(Configuration)\ + true + + + bin\ + obj\TestSuite\$(Configuration)\ + false + + + bin\static_mt\ + obj\TestSuite\$(Configuration)\ + true + + + bin\static_mt\ + obj\TestSuite\$(Configuration)\ + false + + + bin\static_md\ + obj\TestSuite\$(Configuration)\ + true + + + bin\static_md\ + obj\TestSuite\$(Configuration)\ + false + + + bin64\ + obj64\TestSuite\$(Configuration)\ + true + + + bin64\ + obj64\TestSuite\$(Configuration)\ + false + + + bin64\static_mt\ + obj64\TestSuite\$(Configuration)\ + true + + + bin64\static_mt\ + obj64\TestSuite\$(Configuration)\ + false + + + bin64\static_md\ + obj64\TestSuite\$(Configuration)\ + true + + + bin64\static_md\ + obj64\TestSuite\$(Configuration)\ + false + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitd.lib;%(AdditionalDependencies) + bin\TestSuited.exe + ..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\TestSuited.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + CppUnit.lib;%(AdditionalDependencies) + bin\TestSuite.exe + ..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitmtd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin\static_mt\TestSuited.exe + ..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\static_mt\TestSuited.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + CppUnitmt.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin\static_mt\TestSuite.exe + ..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitmdd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin\static_md\TestSuited.exe + ..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\static_md\TestSuited.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + CppUnitmd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin\static_md\TestSuite.exe + ..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitd.lib;%(AdditionalDependencies) + bin64\TestSuited.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\TestSuited.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + CppUnit.lib;%(AdditionalDependencies) + bin64\TestSuite.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitmtd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin64\static_mt\TestSuited.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\static_mt\TestSuited.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + CppUnitmt.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin64\static_mt\TestSuite.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitmdd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin64\static_md\TestSuited.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\static_md\TestSuited.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + CppUnitmd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin64\static_md\TestSuite.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + + + diff --git a/Prometheus/testsuite/TestSuite_vs140.vcxproj.filters b/Prometheus/testsuite/TestSuite_vs140.vcxproj.filters new file mode 100644 index 000000000..dc3880ebc --- /dev/null +++ b/Prometheus/testsuite/TestSuite_vs140.vcxproj.filters @@ -0,0 +1,60 @@ + + + + + {34de6456-93b0-4c4f-afcf-c9e7466f1ceb} + + + {fe5cf256-684c-471c-82e8-d09ec24259c3} + + + + + Source Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Header Files + + + \ No newline at end of file diff --git a/Prometheus/testsuite/TestSuite_vs150.vcxproj b/Prometheus/testsuite/TestSuite_vs150.vcxproj new file mode 100644 index 000000000..369878474 --- /dev/null +++ b/Prometheus/testsuite/TestSuite_vs150.vcxproj @@ -0,0 +1,637 @@ + + + + + debug_shared + Win32 + + + debug_shared + x64 + + + debug_static_md + Win32 + + + debug_static_md + x64 + + + debug_static_mt + Win32 + + + debug_static_mt + x64 + + + release_shared + Win32 + + + release_shared + x64 + + + release_static_md + Win32 + + + release_static_md + x64 + + + release_static_mt + Win32 + + + release_static_mt + x64 + + + + TestSuite + {04B69538-1444-4A22-A98D-3C69CD7B44DA} + TestSuite + Win32Proj + + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + Application + MultiByte + v141 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>15.0.28307.799 + TestSuited + TestSuited + TestSuited + TestSuite + TestSuite + TestSuite + TestSuited + TestSuited + TestSuited + TestSuite + TestSuite + TestSuite + + + bin\ + obj\TestSuite\$(Configuration)\ + true + + + bin\ + obj\TestSuite\$(Configuration)\ + false + + + bin\static_mt\ + obj\TestSuite\$(Configuration)\ + true + + + bin\static_mt\ + obj\TestSuite\$(Configuration)\ + false + + + bin\static_md\ + obj\TestSuite\$(Configuration)\ + true + + + bin\static_md\ + obj\TestSuite\$(Configuration)\ + false + + + bin64\ + obj64\TestSuite\$(Configuration)\ + true + + + bin64\ + obj64\TestSuite\$(Configuration)\ + false + + + bin64\static_mt\ + obj64\TestSuite\$(Configuration)\ + true + + + bin64\static_mt\ + obj64\TestSuite\$(Configuration)\ + false + + + bin64\static_md\ + obj64\TestSuite\$(Configuration)\ + true + + + bin64\static_md\ + obj64\TestSuite\$(Configuration)\ + false + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitd.lib;%(AdditionalDependencies) + bin\TestSuited.exe + ..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\TestSuited.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + CppUnit.lib;%(AdditionalDependencies) + bin\TestSuite.exe + ..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitmtd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin\static_mt\TestSuited.exe + ..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\static_mt\TestSuited.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + CppUnitmt.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin\static_mt\TestSuite.exe + ..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitmdd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin\static_md\TestSuited.exe + ..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\static_md\TestSuited.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + CppUnitmd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin\static_md\TestSuite.exe + ..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitd.lib;%(AdditionalDependencies) + bin64\TestSuited.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\TestSuited.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + CppUnit.lib;%(AdditionalDependencies) + bin64\TestSuite.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitmtd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin64\static_mt\TestSuited.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\static_mt\TestSuited.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + CppUnitmt.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin64\static_mt\TestSuite.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitmdd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin64\static_md\TestSuited.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\static_md\TestSuited.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + CppUnitmd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin64\static_md\TestSuite.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + + + diff --git a/Prometheus/testsuite/TestSuite_vs150.vcxproj.filters b/Prometheus/testsuite/TestSuite_vs150.vcxproj.filters new file mode 100644 index 000000000..0c1d172ab --- /dev/null +++ b/Prometheus/testsuite/TestSuite_vs150.vcxproj.filters @@ -0,0 +1,60 @@ + + + + + {c8e720dc-690b-4251-b06c-483e203456c1} + + + {0c9cdb18-2727-425a-9ac7-f698a21f88f9} + + + + + Source Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Header Files + + + \ No newline at end of file diff --git a/Prometheus/testsuite/TestSuite_vs160.vcxproj b/Prometheus/testsuite/TestSuite_vs160.vcxproj new file mode 100644 index 000000000..8769c281a --- /dev/null +++ b/Prometheus/testsuite/TestSuite_vs160.vcxproj @@ -0,0 +1,637 @@ + + + + + debug_shared + Win32 + + + debug_shared + x64 + + + debug_static_md + Win32 + + + debug_static_md + x64 + + + debug_static_mt + Win32 + + + debug_static_mt + x64 + + + release_shared + Win32 + + + release_shared + x64 + + + release_static_md + Win32 + + + release_static_md + x64 + + + release_static_mt + Win32 + + + release_static_mt + x64 + + + + TestSuite + {04B69538-1444-4A22-A98D-3C69CD7B44DA} + TestSuite + Win32Proj + + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + Application + MultiByte + v142 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>15.0.28307.799 + TestSuited + TestSuited + TestSuited + TestSuite + TestSuite + TestSuite + TestSuited + TestSuited + TestSuited + TestSuite + TestSuite + TestSuite + + + bin\ + obj\TestSuite\$(Configuration)\ + true + + + bin\ + obj\TestSuite\$(Configuration)\ + false + + + bin\static_mt\ + obj\TestSuite\$(Configuration)\ + true + + + bin\static_mt\ + obj\TestSuite\$(Configuration)\ + false + + + bin\static_md\ + obj\TestSuite\$(Configuration)\ + true + + + bin\static_md\ + obj\TestSuite\$(Configuration)\ + false + + + bin64\ + obj64\TestSuite\$(Configuration)\ + true + + + bin64\ + obj64\TestSuite\$(Configuration)\ + false + + + bin64\static_mt\ + obj64\TestSuite\$(Configuration)\ + true + + + bin64\static_mt\ + obj64\TestSuite\$(Configuration)\ + false + + + bin64\static_md\ + obj64\TestSuite\$(Configuration)\ + true + + + bin64\static_md\ + obj64\TestSuite\$(Configuration)\ + false + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitd.lib;%(AdditionalDependencies) + bin\TestSuited.exe + ..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\TestSuited.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + CppUnit.lib;%(AdditionalDependencies) + bin\TestSuite.exe + ..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitmtd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin\static_mt\TestSuited.exe + ..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\static_mt\TestSuited.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + CppUnitmt.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin\static_mt\TestSuite.exe + ..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitmdd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin\static_md\TestSuited.exe + ..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\static_md\TestSuited.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + CppUnitmd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin\static_md\TestSuite.exe + ..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitd.lib;%(AdditionalDependencies) + bin64\TestSuited.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\TestSuited.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + CppUnit.lib;%(AdditionalDependencies) + bin64\TestSuite.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitmtd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin64\static_mt\TestSuited.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\static_mt\TestSuited.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + CppUnitmt.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin64\static_mt\TestSuite.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitmdd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin64\static_md\TestSuited.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\static_md\TestSuited.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + CppUnitmd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin64\static_md\TestSuite.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + + + diff --git a/Prometheus/testsuite/TestSuite_vs160.vcxproj.filters b/Prometheus/testsuite/TestSuite_vs160.vcxproj.filters new file mode 100644 index 000000000..0a40ee0af --- /dev/null +++ b/Prometheus/testsuite/TestSuite_vs160.vcxproj.filters @@ -0,0 +1,60 @@ + + + + + {8340b52f-a1ad-427f-8353-b2eb9fea9dc7} + + + {5643a2e1-b7fd-464e-8cdb-6fe4c774b149} + + + + + Source Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Header Files + + + \ No newline at end of file diff --git a/Prometheus/testsuite/TestSuite_vs170.vcxproj b/Prometheus/testsuite/TestSuite_vs170.vcxproj new file mode 100644 index 000000000..c25df4d25 --- /dev/null +++ b/Prometheus/testsuite/TestSuite_vs170.vcxproj @@ -0,0 +1,637 @@ + + + + + debug_shared + Win32 + + + debug_shared + x64 + + + debug_static_md + Win32 + + + debug_static_md + x64 + + + debug_static_mt + Win32 + + + debug_static_mt + x64 + + + release_shared + Win32 + + + release_shared + x64 + + + release_static_md + Win32 + + + release_static_md + x64 + + + release_static_mt + Win32 + + + release_static_mt + x64 + + + + TestSuite + {04B69538-1444-4A22-A98D-3C69CD7B44DA} + TestSuite + Win32Proj + + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + Application + MultiByte + v143 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>15.0.28307.799 + TestSuited + TestSuited + TestSuited + TestSuite + TestSuite + TestSuite + TestSuited + TestSuited + TestSuited + TestSuite + TestSuite + TestSuite + + + bin\ + obj\TestSuite\$(Configuration)\ + true + + + bin\ + obj\TestSuite\$(Configuration)\ + false + + + bin\static_mt\ + obj\TestSuite\$(Configuration)\ + true + + + bin\static_mt\ + obj\TestSuite\$(Configuration)\ + false + + + bin\static_md\ + obj\TestSuite\$(Configuration)\ + true + + + bin\static_md\ + obj\TestSuite\$(Configuration)\ + false + + + bin64\ + obj64\TestSuite\$(Configuration)\ + true + + + bin64\ + obj64\TestSuite\$(Configuration)\ + false + + + bin64\static_mt\ + obj64\TestSuite\$(Configuration)\ + true + + + bin64\static_mt\ + obj64\TestSuite\$(Configuration)\ + false + + + bin64\static_md\ + obj64\TestSuite\$(Configuration)\ + true + + + bin64\static_md\ + obj64\TestSuite\$(Configuration)\ + false + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitd.lib;%(AdditionalDependencies) + bin\TestSuited.exe + ..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\TestSuited.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + CppUnit.lib;%(AdditionalDependencies) + bin\TestSuite.exe + ..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitmtd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin\static_mt\TestSuited.exe + ..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\static_mt\TestSuited.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + CppUnitmt.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin\static_mt\TestSuite.exe + ..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitmdd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin\static_md\TestSuited.exe + ..\..\lib;%(AdditionalLibraryDirectories) + true + true + bin\static_md\TestSuited.pdb + Console + MachineX86 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + CppUnitmd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin\static_md\TestSuite.exe + ..\..\lib;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitd.lib;%(AdditionalDependencies) + bin64\TestSuited.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\TestSuited.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + CppUnit.lib;%(AdditionalDependencies) + bin64\TestSuite.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitmtd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin64\static_mt\TestSuited.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\static_mt\TestSuited.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreaded + false + true + true + true + + Level3 + + Default + true + + + CppUnitmt.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin64\static_mt\TestSuite.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + Disabled + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + true + true + true + + Level3 + ProgramDatabase + Default + true + + + CppUnitmdd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin64\static_md\TestSuited.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + true + true + bin64\static_md\TestSuited.pdb + Console + MachineX64 + + + + + MaxSpeed + OnlyExplicitInline + true + Speed + true + ..\include;..\..\CppUnit\include;..\..\Foundation\include;..\..\Net\include;..\..\Prometheus\include;.\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + true + true + + Level3 + + Default + true + + + CppUnitmd.lib;iphlpapi.lib;winmm.lib;%(AdditionalDependencies) + bin64\static_md\TestSuite.exe + ..\..\lib64;%(AdditionalLibraryDirectories) + false + Console + true + true + MachineX64 + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + true + + + + + diff --git a/Prometheus/testsuite/TestSuite_vs170.vcxproj.filters b/Prometheus/testsuite/TestSuite_vs170.vcxproj.filters new file mode 100644 index 000000000..bd70dea47 --- /dev/null +++ b/Prometheus/testsuite/TestSuite_vs170.vcxproj.filters @@ -0,0 +1,60 @@ + + + + + {f2c2ac7f-b324-4f93-a1ea-99b8bbd63491} + + + {8abfe308-f380-4ed9-b45b-41f0e51b668c} + + + + + Source Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Header Files + + + \ No newline at end of file diff --git a/Prometheus/testsuite/TestSuite_vs90.vcproj b/Prometheus/testsuite/TestSuite_vs90.vcproj new file mode 100644 index 000000000..00d7a714e --- /dev/null +++ b/Prometheus/testsuite/TestSuite_vs90.vcproj @@ -0,0 +1,630 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Prometheus/testsuite/src/CallbackMetricTest.cpp b/Prometheus/testsuite/src/CallbackMetricTest.cpp new file mode 100644 index 000000000..63e4302d2 --- /dev/null +++ b/Prometheus/testsuite/src/CallbackMetricTest.cpp @@ -0,0 +1,79 @@ +// +// CallbackMetricTest.cpp +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "CallbackMetricTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/Prometheus/CallbackMetric.h" +#include "Poco/Prometheus/Registry.h" +#include "Poco/Prometheus/TextExporter.h" +#include "Poco/Exception.h" +#include + + +using namespace Poco::Prometheus; +using namespace std::string_literals; + + +CallbackMetricTest::CallbackMetricTest(const std::string& name): + CppUnit::TestCase("CallbackMetricTest"s) +{ +} + + +void CallbackMetricTest::testExport() +{ + CallbackIntCounter counter1("counter_1"s, []() + { + return 42; + }); + counter1.help("A test counter"s); + + CallbackIntGauge gauge1("gauge_1"s, []() + { + return 2112; + }); + gauge1.help("A test gauge"s); + + std::ostringstream stream; + TextExporter exporter(stream); + Registry::defaultRegistry().exportTo(exporter); + + const std::string text = stream.str(); + assertEqual( + "# HELP counter_1 A test counter\n" + "# TYPE counter_1 counter\n" + "counter_1 42\n" + "# HELP gauge_1 A test gauge\n" + "# TYPE gauge_1 gauge\n" + "gauge_1 2112\n"s, + text); +} + + +void CallbackMetricTest::setUp() +{ + Registry::defaultRegistry().clear(); +} + + +void CallbackMetricTest::tearDown() +{ +} + + +CppUnit::Test* CallbackMetricTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("CallbackMetricTest"); + + CppUnit_addTest(pSuite, CallbackMetricTest, testExport); + + return pSuite; +} diff --git a/Prometheus/testsuite/src/CallbackMetricTest.h b/Prometheus/testsuite/src/CallbackMetricTest.h new file mode 100644 index 000000000..6fb7be92e --- /dev/null +++ b/Prometheus/testsuite/src/CallbackMetricTest.h @@ -0,0 +1,35 @@ +// +// CallbackMetricTest.h +// +// Definition of the CallbackMetricTest class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef CallbackMetricTest_INCLUDED +#define CallbackMetricTest_INCLUDED + + +#include "CppUnit/TestCase.h" + + +class CallbackMetricTest: public CppUnit::TestCase +{ +public: + CallbackMetricTest(const std::string& name); + ~CallbackMetricTest() = default; + + void testExport(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); +}; + + +#endif // CallbackMetricTest_INCLUDED diff --git a/Prometheus/testsuite/src/CounterTest.cpp b/Prometheus/testsuite/src/CounterTest.cpp new file mode 100644 index 000000000..3024fa38a --- /dev/null +++ b/Prometheus/testsuite/src/CounterTest.cpp @@ -0,0 +1,240 @@ +// +// CounterTest.cpp +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "CounterTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/Prometheus/Counter.h" +#include "Poco/Prometheus/Registry.h" +#include "Poco/Prometheus/TextExporter.h" +#include "Poco/Thread.h" +#include "Poco/Runnable.h" +#include "Poco/Exception.h" +#include + + +using namespace Poco::Prometheus; +using namespace std::string_literals; + + +CounterTest::CounterTest(const std::string& name): + CppUnit::TestCase("CounterTest"s) +{ +} + + +void CounterTest::testBasicBehavior() +{ + Counter counter("counter"s); + + assertEqualDelta(0.0, counter.value(), 0.0); + + counter.inc(); + assertEqualDelta(1.0, counter.value(), 0.0); + + counter.inc(2); + assertEqualDelta(3.0, counter.value(), 0.0); +} + + +void CounterTest::testInvalidName() +{ + try + { + Counter counter("invalid.name"s); + fail("invalid name - must throw"s); + } + catch (Poco::SyntaxException&) + { + } +} + + +void CounterTest::testLabels() +{ + const std::vector labelNames{"label1"s, "label2"}; + + Counter counter("counter"s); + counter.labelNames(labelNames); + + assertTrue(labelNames == counter.labelNames()); + + counter.labels({"value11"s, "value21"s}).inc(); + counter.labels({"value12"s, "value22"s}).inc(2); + + assertEqualDelta(1.0, counter.labels({"value11"s, "value21"s}).value(), 0.0); + assertEqualDelta(2.0, counter.labels({"value12"s, "value22"s}).value(), 0.0); + + assertEqual(2, counter.sampleCount()); + + counter.remove({"value12"s, "value22"s}); + assertEqual(1, counter.sampleCount()); + + counter.clear(); + assertEqual(0, counter.sampleCount()); + + try + { + counter.labels({"value11"s}).inc(); + fail("missing label values - must throw"s); + } + catch (Poco::InvalidArgumentException&) + { + } + + try + { + counter.labels({"value11"s, "value21"s, "value31"s}).inc(); + fail("too many label values - must throw"s); + } + catch (Poco::InvalidArgumentException&) + { + } + + try + { + counter.labelNames({"label3"s, "label4"s}); + fail("cannot change label values - must throw"); + } + catch (Poco::IllegalStateException&) + { + } + + try + { + Counter counter2("counter2"s); + counter2.labelNames({"invalid.value"s}); + fail("invalid label name - must throw"s); + } + catch (Poco::SyntaxException&) + { + } +} + + +void CounterTest::testConcurrency() +{ + class R: public Poco::Runnable + { + public: + R(Counter& c, int n): + _c(c), + _n(n) + { + } + + void run() + { + for (int i = 0; i < _n; i++) + { + _c.inc(); + } + } + + private: + Counter& _c; + int _n; + }; + + Poco::Thread t1; + Poco::Thread t2; + Poco::Thread t3; + Poco::Thread t4; + + Counter counter("counter1"s); + const int n = 1000000; + + R r(counter, n); + t1.start(r); + t2.start(r); + t3.start(r); + t4.start(r); + t1.join(); + t2.join(); + t3.join(); + t4.join(); + + assertEqualDelta(4.0*n, counter.value(), 0.0); +} + + +void CounterTest::testExport() +{ + Counter counter1("counter_1"s); + counter1.help("A test counter"s); + + Counter counter2("counter_2"s); + counter2.help("Another test counter"s); + + Counter counter3("counter_3"s, { + /*.help =*/ "A test counter with one label"s, + /*.labelNames =*/ {"label1"s} + }); + + Counter counter4("counter_4"s, { + /*.help =*/ "A test counter with two labels"s, + /*.labelNames =*/ {"label1"s, "label2"s} + }); + + counter2.inc(); + + counter3.labels({"value11"}).inc(2); + counter3.labels({"value12"}).inc(3); + + counter4.labels({"value11"s, "value21"s}).inc(4); + counter4.labels({"value12"s, "value22"s}).inc(5); + + std::ostringstream stream; + TextExporter exporter(stream); + Registry::defaultRegistry().exportTo(exporter); + + const std::string text = stream.str(); + assertEqual( + "# HELP counter_1 A test counter\n" + "# TYPE counter_1 counter\n" + "counter_1 0\n" + "# HELP counter_2 Another test counter\n" + "# TYPE counter_2 counter\n" + "counter_2 1\n" + "# HELP counter_3 A test counter with one label\n" + "# TYPE counter_3 counter\n" + "counter_3{label1=\"value11\"} 2\n" + "counter_3{label1=\"value12\"} 3\n" + "# HELP counter_4 A test counter with two labels\n" + "# TYPE counter_4 counter\n" + "counter_4{label1=\"value11\",label2=\"value21\"} 4\n" + "counter_4{label1=\"value12\",label2=\"value22\"} 5\n"s, + text); +} + + +void CounterTest::setUp() +{ + Registry::defaultRegistry().clear(); +} + + +void CounterTest::tearDown() +{ +} + + +CppUnit::Test* CounterTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("CounterTest"); + + CppUnit_addTest(pSuite, CounterTest, testBasicBehavior); + CppUnit_addTest(pSuite, CounterTest, testInvalidName); + CppUnit_addTest(pSuite, CounterTest, testLabels); + CppUnit_addTest(pSuite, CounterTest, testConcurrency); + CppUnit_addTest(pSuite, CounterTest, testExport); + + return pSuite; +} diff --git a/Prometheus/testsuite/src/CounterTest.h b/Prometheus/testsuite/src/CounterTest.h new file mode 100644 index 000000000..b15f9113d --- /dev/null +++ b/Prometheus/testsuite/src/CounterTest.h @@ -0,0 +1,39 @@ +// +// CounterTest.h +// +// Definition of the CounterTest class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef CounterTest_INCLUDED +#define CounterTest_INCLUDED + + +#include "CppUnit/TestCase.h" + + +class CounterTest: public CppUnit::TestCase +{ +public: + CounterTest(const std::string& name); + ~CounterTest() = default; + + void testBasicBehavior(); + void testInvalidName(); + void testLabels(); + void testConcurrency(); + void testExport(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); +}; + + +#endif // CounterTest_INCLUDED diff --git a/Prometheus/testsuite/src/Driver.cpp b/Prometheus/testsuite/src/Driver.cpp new file mode 100644 index 000000000..8c7890818 --- /dev/null +++ b/Prometheus/testsuite/src/Driver.cpp @@ -0,0 +1,17 @@ +// +// Driver.cpp +// +// Console-based test driver for Poco Prometheus. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "CppUnit/TestRunner.h" +#include "PrometheusTestSuite.h" + + +CppUnitMain(PrometheusTestSuite) diff --git a/Prometheus/testsuite/src/GaugeTest.cpp b/Prometheus/testsuite/src/GaugeTest.cpp new file mode 100644 index 000000000..a628b7a4e --- /dev/null +++ b/Prometheus/testsuite/src/GaugeTest.cpp @@ -0,0 +1,204 @@ +// +// GaugeTest.cpp +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "GaugeTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/Prometheus/Gauge.h" +#include "Poco/Prometheus/Registry.h" +#include "Poco/Prometheus/TextExporter.h" +#include "Poco/Exception.h" +#include +#include + + +using namespace Poco::Prometheus; +using namespace std::string_literals; + + +GaugeTest::GaugeTest(const std::string& name): + CppUnit::TestCase("GaugeTest"s) +{ +} + + +void GaugeTest::testBasicBehavior() +{ + Gauge gauge("gauge"s); + + assertEqualDelta(0.0, gauge.value(), 0.0); + + gauge.inc(); + assertEqualDelta(1.0, gauge.value(), 0.0); + + gauge.inc(2.0); + assertEqualDelta(3.0, gauge.value(), 0.0); + + gauge.dec(2.0); + assertEqualDelta(1.0, gauge.value(), 0.0); + + gauge.set(5.0); + assertEqualDelta(5.0, gauge.value(), 0.0); +} + + +void GaugeTest::testInvalidName() +{ + try + { + Gauge gauge("invalid.name"s); + fail("invalid name - must throw"s); + } + catch (Poco::SyntaxException&) + { + } +} + + +void GaugeTest::testLabels() +{ + const std::vector labelNames{"label1"s, "label2"}; + + Gauge gauge("gauge"s); + gauge.labelNames(labelNames); + + assertTrue(labelNames == gauge.labelNames()); + + gauge.labels({"value11"s, "value21"s}).inc(); + gauge.labels({"value12"s, "value22"s}).inc(2); + + assertEqualDelta(1.0, gauge.labels({"value11"s, "value21"s}).value(), 0.0); + assertEqualDelta(2.0, gauge.labels({"value12"s, "value22"s}).value(), 0.0); + + try + { + gauge.labels({"value11"s}).inc(); + fail("no label values - must throw"s); + } + catch (Poco::InvalidArgumentException&) + { + } + + try + { + gauge.labels({"value11"s, "value21"s, "value31"s}).inc(); + fail("too many label values - must throw"s); + } + catch (Poco::InvalidArgumentException&) + { + } + + try + { + gauge.labelNames({"label3"s, "label4"s}); + fail("cannot change label values - must throw"); + } + catch (Poco::IllegalStateException&) + { + } + + try + { + Gauge gauge2("Gauge2"s); + gauge2.labelNames({"invalid.value"s}); + fail("invalid label name - must throw"s); + } + catch (Poco::SyntaxException&) + { + } +} + + +void GaugeTest::testExport() +{ + Gauge gauge1("gauge_1"s); + gauge1.help("A test gauge"s); + + Gauge gauge2("gauge_2"s); + gauge2.help("Another test gauge"s); + + Gauge gauge3("gauge_3"s, { + /*.help =*/ "A test gauge with one label"s, + /*.labelNames =*/ {"label1"s} + }); + + Gauge gauge4("gauge_4"s, { + /*.help =*/ "A test gauge with two labels"s, + /*.labelNames =*/ {"label1"s, "label2"s} + }); + + gauge2.inc(); + + gauge3.labels({"value11"}).inc(2); + gauge3.labels({"value12"}).inc(3); + + gauge4.labels({"value11"s, "value21"s}).inc(4); + gauge4.labels({"value12"s, "value22"s}).inc(5); + + Gauge gauge5("gauge_5"s, { + /*.help =*/ "A test for special values"s, + /*.labelNames =*/ {"test"s} + }); + + gauge5.labels({"+Inf"}).set(INFINITY); + gauge5.labels({"-Inf"}).set(-INFINITY); + gauge5.labels({"NaN"}).set(NAN); + + std::ostringstream stream; + TextExporter exporter(stream); + Registry::defaultRegistry().exportTo(exporter); + + const std::string text = stream.str(); + assertEqual( + "# HELP gauge_1 A test gauge\n" + "# TYPE gauge_1 gauge\n" + "gauge_1 0\n" + "# HELP gauge_2 Another test gauge\n" + "# TYPE gauge_2 gauge\n" + "gauge_2 1\n" + "# HELP gauge_3 A test gauge with one label\n" + "# TYPE gauge_3 gauge\n" + "gauge_3{label1=\"value11\"} 2\n" + "gauge_3{label1=\"value12\"} 3\n" + "# HELP gauge_4 A test gauge with two labels\n" + "# TYPE gauge_4 gauge\n" + "gauge_4{label1=\"value11\",label2=\"value21\"} 4\n" + "gauge_4{label1=\"value12\",label2=\"value22\"} 5\n" + "# HELP gauge_5 A test for special values\n" + "# TYPE gauge_5 gauge\n" + "gauge_5{test=\"+Inf\"} +Inf\n" + "gauge_5{test=\"-Inf\"} -Inf\n" + "gauge_5{test=\"NaN\"} NaN\n"s, + text); +} + + +void GaugeTest::setUp() +{ + Registry::defaultRegistry().clear(); +} + + +void GaugeTest::tearDown() +{ +} + + +CppUnit::Test* GaugeTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("GaugeTest"); + + CppUnit_addTest(pSuite, GaugeTest, testBasicBehavior); + CppUnit_addTest(pSuite, GaugeTest, testInvalidName); + CppUnit_addTest(pSuite, GaugeTest, testLabels); + CppUnit_addTest(pSuite, GaugeTest, testExport); + + return pSuite; +} diff --git a/Prometheus/testsuite/src/GaugeTest.h b/Prometheus/testsuite/src/GaugeTest.h new file mode 100644 index 000000000..2a4f1e702 --- /dev/null +++ b/Prometheus/testsuite/src/GaugeTest.h @@ -0,0 +1,38 @@ +// +// GaugeTest.h +// +// Definition of the GaugeTest class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef GaugeTest_INCLUDED +#define GaugeTest_INCLUDED + + +#include "CppUnit/TestCase.h" + + +class GaugeTest: public CppUnit::TestCase +{ +public: + GaugeTest(const std::string& name); + ~GaugeTest() = default; + + void testBasicBehavior(); + void testInvalidName(); + void testLabels(); + void testExport(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); +}; + + +#endif // GaugeTest_INCLUDED diff --git a/Prometheus/testsuite/src/HistogramTest.cpp b/Prometheus/testsuite/src/HistogramTest.cpp new file mode 100644 index 000000000..65f76eea3 --- /dev/null +++ b/Prometheus/testsuite/src/HistogramTest.cpp @@ -0,0 +1,178 @@ +// +// HistogramTest.cpp +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "HistogramTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/Prometheus/Histogram.h" +#include "Poco/Prometheus/Registry.h" +#include "Poco/Prometheus/TextExporter.h" +#include "Poco/Exception.h" +#include + + +using namespace Poco::Prometheus; +using namespace std::string_literals; + + +HistogramTest::HistogramTest(const std::string& name): + CppUnit::TestCase("HistogramTest"s) +{ +} + + +void HistogramTest::testNoBuckets() +{ + Histogram histo("histo"s); + + histo.observe(1.0); + histo.observe(2.0); + + const auto data = histo.data(); + assertEqual(0, data.bucketCounts.size()); + assertEqual(2, data.count); + assertEqualDelta(3.0, data.sum, 0.0); +} + + +void HistogramTest::testBuckets() +{ + Histogram histo("histo"s); + histo.buckets({1.0, 2.0, 3.0}); + + histo.observe(1.1); + histo.observe(2.0); + histo.observe(2.5); + histo.observe(4.0); + + const auto data = histo.data(); + assertEqual(3, data.bucketCounts.size()); + assertEqual(0, data.bucketCounts[0]); + assertEqual(2, data.bucketCounts[1]); + assertEqual(3, data.bucketCounts[2]); + + assertEqual(4, data.count); + assertEqualDelta(9.6, data.sum, 0.001); +} + + +void HistogramTest::testLabels() +{ + Histogram histo("histo"s); + histo + .buckets({1.0, 2.0, 3.0}) + .labelNames({"label"s}); + + histo.labels({"value1"s}).observe(1.1); + histo.labels({"value1"s}).observe(2.0); + histo.labels({"value1"s}).observe(2.5); + histo.labels({"value1"s}).observe(4.0); + + histo.labels({"value2"s}).observe(3.0); + histo.labels({"value2"s}).observe(5.0); + + const auto data1 = histo.labels({"value1"s}).data(); + assertEqual(3, data1.bucketCounts.size()); + assertEqual(0, data1.bucketCounts[0]); + assertEqual(2, data1.bucketCounts[1]); + assertEqual(3, data1.bucketCounts[2]); + + assertEqual(4, data1.count); + assertEqualDelta(9.6, data1.sum, 0.001); + + const auto data2 = histo.labels({"value2"s}).data(); + assertEqual(3, data2.bucketCounts.size()); + assertEqual(0, data2.bucketCounts[0]); + assertEqual(0, data2.bucketCounts[1]); + assertEqual(1, data2.bucketCounts[2]); + + assertEqual(2, data2.count); + assertEqualDelta(8.0, data2.sum, 0.001); +} + + +void HistogramTest::testExport() +{ + Histogram histo1("histo_1"s); + + histo1.observe(1.0); + histo1.observe(2.0); + + Histogram histo2("histo_2"s, { + /*.help =*/ "A histogram with buckets"s, + /* .labelNames =*/ {}, + /*.buckets =*/ {1.0, 2.0, 3.0} + }); + + histo2.observe(1.1); + histo2.observe(2.0); + histo2.observe(2.5); + histo2.observe(4.0); + + Histogram histo3("histo_3"s, { + /*.help =*/ "A histogram with labels"s, + /*.labelNames =*/ {"label"s}, + /*.buckets =*/ {1.0, 2.0} + }); + + histo3.labels({"value1"s}).observe(1.0); + histo3.labels({"value1"s}).observe(2.0); + + std::ostringstream stream; + TextExporter exporter(stream); + Registry::defaultRegistry().exportTo(exporter); + + const std::string text = stream.str(); + assertEqual( + "# TYPE histo_1 histogram\n" + "histo_1_bucket{le=\"+Inf\"} 2\n" + "histo_1_sum 3\n" + "histo_1_count 2\n" + "# HELP histo_2 A histogram with buckets\n" + "# TYPE histo_2 histogram\n" + "histo_2_bucket{le=\"1\"} 0\n" + "histo_2_bucket{le=\"2\"} 2\n" + "histo_2_bucket{le=\"3\"} 3\n" + "histo_2_bucket{le=\"+Inf\"} 4\n" + "histo_2_sum 9.6\n" + "histo_2_count 4\n" + "# HELP histo_3 A histogram with labels\n" + "# TYPE histo_3 histogram\n" + "histo_3_bucket{label=\"value1\",le=\"1\"} 1\n" + "histo_3_bucket{label=\"value1\",le=\"2\"} 2\n" + "histo_3_bucket{label=\"value1\",le=\"+Inf\"} 2\n" + "histo_3_sum{label=\"value1\"} 3\n" + "histo_3_count{label=\"value1\"} 2\n"s, + text); +} + + +void HistogramTest::setUp() +{ + Registry::defaultRegistry().clear(); +} + + +void HistogramTest::tearDown() +{ +} + + +CppUnit::Test* HistogramTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("HistogramTest"); + + CppUnit_addTest(pSuite, HistogramTest, testNoBuckets); + CppUnit_addTest(pSuite, HistogramTest, testBuckets); + CppUnit_addTest(pSuite, HistogramTest, testLabels); + CppUnit_addTest(pSuite, HistogramTest, testExport); + + return pSuite; +} diff --git a/Prometheus/testsuite/src/HistogramTest.h b/Prometheus/testsuite/src/HistogramTest.h new file mode 100644 index 000000000..0e15fd4a7 --- /dev/null +++ b/Prometheus/testsuite/src/HistogramTest.h @@ -0,0 +1,38 @@ +// +// HistogramTest.h +// +// Definition of the HistogramTest class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef HistogramTest_INCLUDED +#define HistogramTest_INCLUDED + + +#include "CppUnit/TestCase.h" + + +class HistogramTest: public CppUnit::TestCase +{ +public: + HistogramTest(const std::string& name); + ~HistogramTest() = default; + + void testNoBuckets(); + void testBuckets(); + void testLabels(); + void testExport(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); +}; + + +#endif // HistogramTest_INCLUDED diff --git a/Prometheus/testsuite/src/IntCounterTest.cpp b/Prometheus/testsuite/src/IntCounterTest.cpp new file mode 100644 index 000000000..33999cef4 --- /dev/null +++ b/Prometheus/testsuite/src/IntCounterTest.cpp @@ -0,0 +1,90 @@ +// +// IntCounterTest.cpp +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "IntCounterTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/Prometheus/IntCounter.h" +#include "Poco/Prometheus/Registry.h" +#include "Poco/Prometheus/TextExporter.h" +#include "Poco/Exception.h" +#include + + +using namespace Poco::Prometheus; +using namespace std::string_literals; + + +IntCounterTest::IntCounterTest(const std::string& name): + CppUnit::TestCase("IntCounterTest"s) +{ +} + + +void IntCounterTest::testBasicBehavior() +{ + IntCounter counter("counter"s); + + assertEqual(0, counter.value()); + + counter.inc(); + assertEqual(1, counter.value()); + + counter.inc(2); + assertEqual(3, counter.value()); +} + + +void IntCounterTest::testExport() +{ + IntCounter counter1("counter_1"s); + counter1.help("A test counter"s); + + IntCounter counter2("counter_2"s); + counter2.help("Another test counter"s); + + counter2.inc(42); + + std::ostringstream stream; + TextExporter exporter(stream); + Registry::defaultRegistry().exportTo(exporter); + + const std::string text = stream.str(); + assertEqual( + "# HELP counter_1 A test counter\n" + "# TYPE counter_1 counter\n" + "counter_1 0\n" + "# HELP counter_2 Another test counter\n" + "# TYPE counter_2 counter\n" + "counter_2 42\n"s, + text); +} + + +void IntCounterTest::setUp() +{ + Registry::defaultRegistry().clear(); +} + + +void IntCounterTest::tearDown() +{ +} + + +CppUnit::Test* IntCounterTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("IntCounterTest"); + + CppUnit_addTest(pSuite, IntCounterTest, testBasicBehavior); + CppUnit_addTest(pSuite, IntCounterTest, testExport); + + return pSuite; +} diff --git a/Prometheus/testsuite/src/IntCounterTest.h b/Prometheus/testsuite/src/IntCounterTest.h new file mode 100644 index 000000000..0d1173e98 --- /dev/null +++ b/Prometheus/testsuite/src/IntCounterTest.h @@ -0,0 +1,36 @@ +// +// IntCounterTest.h +// +// Definition of the IntCounterTest class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef IntCounterTest_INCLUDED +#define IntCounterTest_INCLUDED + + +#include "CppUnit/TestCase.h" + + +class IntCounterTest: public CppUnit::TestCase +{ +public: + IntCounterTest(const std::string& name); + ~IntCounterTest() = default; + + void testBasicBehavior(); + void testExport(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); +}; + + +#endif // IntCounterTest_INCLUDED diff --git a/Prometheus/testsuite/src/IntGaugeTest.cpp b/Prometheus/testsuite/src/IntGaugeTest.cpp new file mode 100644 index 000000000..2949c0d52 --- /dev/null +++ b/Prometheus/testsuite/src/IntGaugeTest.cpp @@ -0,0 +1,96 @@ +// +// IntGaugeTest.cpp +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "IntGaugeTest.h" +#include "CppUnit/TestCaller.h" +#include "CppUnit/TestSuite.h" +#include "Poco/Prometheus/IntGauge.h" +#include "Poco/Prometheus/Registry.h" +#include "Poco/Prometheus/TextExporter.h" +#include "Poco/Exception.h" +#include + + +using namespace Poco::Prometheus; +using namespace std::string_literals; + + +IntGaugeTest::IntGaugeTest(const std::string& name): + CppUnit::TestCase("IntGaugeTest"s) +{ +} + + +void IntGaugeTest::testBasicBehavior() +{ + IntGauge gauge("gauge"s); + + assertEqual(0, gauge.value()); + + gauge.inc(); + assertEqual(1, gauge.value()); + + gauge.inc(2); + assertEqual(3, gauge.value()); + + gauge.dec(2); + assertEqual(1, gauge.value()); + + gauge.set(5); + assertEqual(5, gauge.value()); +} + + +void IntGaugeTest::testExport() +{ + IntGauge gauge1("gauge_1"s); + gauge1.help("A test gauge"s); + + IntGauge gauge2("gauge_2"s); + gauge2.help("Another test gauge"s); + + gauge2.inc(42); + + std::ostringstream stream; + TextExporter exporter(stream); + Registry::defaultRegistry().exportTo(exporter); + + const std::string text = stream.str(); + assertEqual( + "# HELP gauge_1 A test gauge\n" + "# TYPE gauge_1 gauge\n" + "gauge_1 0\n" + "# HELP gauge_2 Another test gauge\n" + "# TYPE gauge_2 gauge\n" + "gauge_2 42\n"s, + text); +} + + +void IntGaugeTest::setUp() +{ + Registry::defaultRegistry().clear(); +} + + +void IntGaugeTest::tearDown() +{ +} + + +CppUnit::Test* IntGaugeTest::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("IntGaugeTest"); + + CppUnit_addTest(pSuite, IntGaugeTest, testBasicBehavior); + CppUnit_addTest(pSuite, IntGaugeTest, testExport); + + return pSuite; +} diff --git a/Prometheus/testsuite/src/IntGaugeTest.h b/Prometheus/testsuite/src/IntGaugeTest.h new file mode 100644 index 000000000..ee076d0af --- /dev/null +++ b/Prometheus/testsuite/src/IntGaugeTest.h @@ -0,0 +1,36 @@ +// +// IntGaugeTest.h +// +// Definition of the IntGaugeTest class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef IntGaugeTest_INCLUDED +#define IntGaugeTest_INCLUDED + + +#include "CppUnit/TestCase.h" + + +class IntGaugeTest: public CppUnit::TestCase +{ +public: + IntGaugeTest(const std::string& name); + ~IntGaugeTest() = default; + + void testBasicBehavior(); + void testExport(); + + void setUp(); + void tearDown(); + + static CppUnit::Test* suite(); +}; + + +#endif // IntGaugeTest_INCLUDED diff --git a/Prometheus/testsuite/src/PrometheusTestSuite.cpp b/Prometheus/testsuite/src/PrometheusTestSuite.cpp new file mode 100644 index 000000000..81df25f94 --- /dev/null +++ b/Prometheus/testsuite/src/PrometheusTestSuite.cpp @@ -0,0 +1,32 @@ +// +// PrometheusTestSuite.cpp +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "PrometheusTestSuite.h" +#include "CounterTest.h" +#include "GaugeTest.h" +#include "IntCounterTest.h" +#include "IntGaugeTest.h" +#include "CallbackMetricTest.h" +#include "HistogramTest.h" + + +CppUnit::Test* PrometheusTestSuite::suite() +{ + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("PrometheusTestSuite"); + + pSuite->addTest(CounterTest::suite()); + pSuite->addTest(GaugeTest::suite()); + pSuite->addTest(IntCounterTest::suite()); + pSuite->addTest(IntGaugeTest::suite()); + pSuite->addTest(CallbackMetricTest::suite()); + pSuite->addTest(HistogramTest::suite()); + + return pSuite; +} diff --git a/Prometheus/testsuite/src/PrometheusTestSuite.h b/Prometheus/testsuite/src/PrometheusTestSuite.h new file mode 100644 index 000000000..52b4a51f6 --- /dev/null +++ b/Prometheus/testsuite/src/PrometheusTestSuite.h @@ -0,0 +1,27 @@ +// +// PrometheusTestSuite.h +// +// Definition of the PrometheusTestSuite class. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#ifndef PrometheusTestSuite_INCLUDED +#define PrometheusTestSuite_INCLUDED + + +#include "CppUnit/TestSuite.h" + + +class PrometheusTestSuite +{ +public: + static CppUnit::Test* suite(); +}; + + +#endif // PrometheusTestSuite_INCLUDED diff --git a/Prometheus/testsuite/src/WinCEDriver.cpp b/Prometheus/testsuite/src/WinCEDriver.cpp new file mode 100644 index 000000000..b17d86e24 --- /dev/null +++ b/Prometheus/testsuite/src/WinCEDriver.cpp @@ -0,0 +1,30 @@ +// +// WinCEDriver.cpp +// +// Console-based test driver for Windows CE. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "CppUnit/TestRunner.h" +#include "PrometheusTestSuite.h" +#include + + +int _tmain(int argc, wchar_t* argv[]) +{ + std::vector args; + for (int i = 0; i < argc; ++i) + { + char buffer[1024]; + std::wcstombs(buffer, argv[i], sizeof(buffer)); + args.push_back(std::string(buffer)); + } + CppUnit::TestRunner runner; + runner.addTest("PrometheusTestSuite", PrometheusTestSuite::suite()); + return runner.run(args) ? 0 : 1; +} diff --git a/Prometheus/testsuite/src/WinDriver.cpp b/Prometheus/testsuite/src/WinDriver.cpp new file mode 100644 index 000000000..8a6b47b24 --- /dev/null +++ b/Prometheus/testsuite/src/WinDriver.cpp @@ -0,0 +1,28 @@ +// +// WinDriver.cpp +// +// Windows test driver for Poco Prometheus. +// +// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "WinTestRunner/WinTestRunner.h" +#include "PrometheusTestSuite.h" + + +class TestDriver: public CppUnit::WinTestRunnerApp +{ + void TestMain() + { + CppUnit::WinTestRunner runner; + runner.addTest(PrometheusTestSuite::suite()); + runner.run(); + } +}; + + +TestDriver theDriver; diff --git a/components b/components index 21381003f..11773ba42 100644 --- a/components +++ b/components @@ -21,6 +21,7 @@ PDF CppParser MongoDB Redis +Prometheus ActiveRecord ActiveRecord/Compiler PocoDoc