Skip to content

TeiaCarePrometheus is a C++ client library that implements the Prometheus Data Model

License

Notifications You must be signed in to change notification settings

TeiaCare/TeiaCarePrometheus

Repository files navigation

TeiaCarePrometheus

Welcome to TeiaCarePrometheus!

TeiaCarePrometheus is a C++ client library that implements the Prometheus Data Model.

Docs Codacy Badge Codacy Badge

TeiaCarePrometheus

Getting Started

This project uses git submodules so it is required to clone it using the --recursive flag in order to retrive the required submodules.

git clone https://github.com/TeiaCare/TeiaCarePrometheus.git --recursive

Create Development Environment

In order to setup a development environment it is sufficient to run the script scripts/env/setup.<bat|sh> depending on your operating system.

# Linux/MacOS
scripts/env/setup.sh

# Windows
scripts\env\setup.bat

Start Development Environment

In order to start the development environment it is sufficient to activate the Python Virtual Environment just created the step above.

# Linux/MacOS
source .venv/bin/activate

# Windows
.venv\Scripts\activate.bat

Setup Build Environment (Windows Only)

When building from command line on Windows it is necessary to activate the Visual Studio Developer Command Prompt.

Depending on the version of Visual Studio compiler and on its install location it is required to run vcvars64.bat script the set the development environment properly.

Note: using Visual Studio IDE or the CMake extension for VSCode this step is already managed in the background, so no action is required.

Examples:

# Visual Studio 2022 - Build Tools
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"

# Visual Studio 2019 - Enterprise
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"

Dependencies Setup

This script must be executed in order to setup the 3rd party dependencies using conan packages.

conan remote add teiacare https://artifactory.app.teiacare.com/artifactory/api/conan/teiacare --insert 0 --force
conan user <USERNAME> -p <PASSWORD> -r teiacare

python scripts/conan/setup.py <Debug|Release|RelWithDebInfo> <COMPILER_NAME> <COMPILER_VERSION>

Configure, Build and Install

This script configures, builds and installs the library.

python scripts/cmake.py <Debug|Release|RelWithDebInfo> <COMPILER_NAME> <COMPILER_VERSION>

Examples

# Build all the examples
python scripts/cmake.py <Debug|Release|RelWithDebInfo> <COMPILER_NAME> <COMPILER_VERSION> --examples --warnings

# Run all the examples
python scripts/tools/run_examples.py install/examples

Examples are installed in $PWD/install/examples.

Unit Tests and Code Coverage

# Build Unit Tests with Code Coverage enabled (if supported)
python scripts/cmake.py <Debug|Release|RelWithDebInfo> <COMPILER_NAME> <COMPILER_VERSION> --coverage --warnings

# Run Unit Tests
python scripts/tools/run_unit_tests.py <Debug|Release|RelWithDebInfo>

# Run Code Covergae
python scripts/tools/run_coverage.py <COMPILER_NAME> <COMPILER_VERSION> prometheus_client

Note that code coverage is not available on Windows.

Unit tests results are available in $PWD/results/unit_tests. Coverage results are available in $PWD/results/coverage.

Sanitizers

Address Sanitizer

# Build Unit Tests with Address Sanitizer enabled (if supported)
python scripts/cmake.py <Debug|Release|RelWithDebInfo> <COMPILER_NAME> <COMPILER_VERSION> --address_sanitizer --unit_tests

# Run Unit Tests with Address Sanitizer
python scripts/tools/run_sanitizer.py --address_sanitizer install/unit_tests/teiacare_video_io_unit_tests

Note that Address Sanitizer is supported only on Linux.

Thread Sanitizer

# Build Unit Tests with Thread Sanitizer enabled (if supported)
python scripts/cmake.py <Debug|Release|RelWithDebInfo> <COMPILER_NAME> <COMPILER_VERSION> --thread_sanitizer --unit_tests

# Run Unit Tests with Thread Sanitizer
python scripts/tools/run_sanitizer.py --thread_sanitizer install/unit_tests/teiacare_video_io_unit_tests

Note that Thread Sanitizer is supported only on Linux.

About

TeiaCarePrometheus is a C++ client library that implements the Prometheus Data Model

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published