Skip to content

Commit ff192e0

Browse files
committed
prometheus-cpp-0.12.3-apama2
0 parents  commit ff192e0

137 files changed

Lines changed: 7808 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bazelignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3rdparty

.bazelrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
build:asan --strip=never
2+
build:asan --copt -fsanitize=address
3+
build:asan --copt -DADDRESS_SANITIZER
4+
build:asan --copt -O0
5+
build:asan --copt -fno-omit-frame-pointer
6+
build:asan --copt -g
7+
build:asan --linkopt -fsanitize=address
8+
build:asan --cc_output_directory_tag=asan

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
BasedOnStyle: Google

.github/workflows/bazel-ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Bazel CI
2+
on: [push, pull_request]
3+
4+
jobs:
5+
build:
6+
name: Bazel on ${{ matrix.os }}
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
os: [macos-latest, ubuntu-20.04, windows-2019]
11+
steps:
12+
- name: Checkout source
13+
uses: actions/checkout@v2
14+
15+
- name: Generate German locale on Ubuntu
16+
if: runner.os == 'Linux'
17+
run: |
18+
sudo apt-get remove -y --purge man-db # avoid time-consuming trigger
19+
sudo apt-get update
20+
sudo apt-get install -y locales
21+
sudo locale-gen de_DE.UTF-8 # used by SerializerTest
22+
23+
- name: Install telegraf on Ubuntu
24+
if: runner.os == 'Linux'
25+
run: |
26+
curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
27+
source /etc/lsb-release
28+
echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
29+
sudo apt-get update
30+
sudo apt-get install -y telegraf
31+
32+
- name: Install telegraf on macOS
33+
if: runner.os == 'macOS'
34+
run: brew install telegraf
35+
36+
- name: Build
37+
run: bazel build //...
38+
39+
- name: Test
40+
run: bazel test --test_output=all //core/... //pull/...
41+
42+
- name: Scraping Test
43+
if: runner.os != 'Windows'
44+
run: bazel test --test_output=all //pull/tests/integration:scrape-test
45+
46+
- name: Benchmark
47+
run: bazel run -c opt //core/benchmarks

.github/workflows/cmake-ci.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: CMake CI
2+
on: [push, pull_request]
3+
4+
jobs:
5+
build:
6+
name: CMake on ${{ matrix.os }} with ${{ matrix.dependencies }}
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
os: [macOS-latest, ubuntu-18.04, windows-2016]
12+
dependencies: [submodule, vcpkg]
13+
steps:
14+
- name: Checkout source
15+
uses: actions/checkout@v2
16+
17+
- name: Checkout submodules
18+
if: matrix.dependencies == 'submodule'
19+
shell: bash
20+
run: |
21+
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
22+
git submodule sync --recursive
23+
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
24+
25+
- name: Mount vcpkg cache
26+
if: matrix.dependencies == 'vcpkg'
27+
uses: actions/cache@v2
28+
with:
29+
path: "~/.cache/vcpkg/archives"
30+
key: vcpkg-${{ matrix.os }}
31+
32+
- name: Install vcpkg dependencies
33+
if: matrix.dependencies == 'vcpkg'
34+
run: vcpkg install benchmark civetweb curl[core] gtest zlib
35+
36+
- name: Generate German locale on Ubuntu
37+
if: runner.os == 'Linux'
38+
run: |
39+
sudo apt-get remove -y --purge man-db # avoid time-consuming trigger
40+
sudo apt-get update
41+
sudo apt-get install -y locales
42+
sudo locale-gen de_DE.UTF-8 # used by SerializerTest
43+
44+
- name: Install ninja on Ubuntu
45+
if: runner.os == 'Linux'
46+
run: |
47+
sudo apt-get install -y ninja-build
48+
49+
- name: Install ninja on macOS
50+
if: runner.os == 'macOS'
51+
run: brew install ninja
52+
53+
- name: "Configure for Unix with internal dependencies"
54+
if: matrix.dependencies == 'submodule' && runner.os != 'Windows'
55+
run: cmake -DUSE_THIRDPARTY_LIBRARIES=ON -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/_install -DENABLE_WARNINGS_AS_ERRORS=ON -DENABLE_COMPRESSION=OFF -DENABLE_PUSH=OFF -DCMAKE_DEBUG_POSTFIX=_d -DCMAKE_CONFIGURATION_TYPES='Release;Debug' -G"Ninja Multi-Config" -S ${{ github.workspace }} -B ${{ github.workspace }}/_build
56+
57+
- name: "Configure for Windows with internal dependencies"
58+
if: matrix.dependencies == 'submodule' && runner.os == 'Windows'
59+
run: cmake -DUSE_THIRDPARTY_LIBRARIES=ON -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/_install -DENABLE_WARNINGS_AS_ERRORS=ON -DENABLE_COMPRESSION=OFF -DENABLE_PUSH=OFF -DCMAKE_DEBUG_POSTFIX=_d -S ${{ github.workspace }} -B ${{ github.workspace }}/_build
60+
61+
- name: "Configure for Unix with vcpkg dependencies"
62+
if: matrix.dependencies == 'vcpkg' && runner.os != 'Windows'
63+
run: cmake -DUSE_THIRDPARTY_LIBRARIES=OFF -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/_install "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" -DCMAKE_DEBUG_POSTFIX=_d -DCMAKE_CONFIGURATION_TYPES='Release;Debug' -G"Ninja Multi-Config" -S ${{ github.workspace }} -B ${{ github.workspace }}/_build
64+
65+
- name: "Configure for Windows with vcpkg dependencies"
66+
if: matrix.dependencies == 'vcpkg' && runner.os == 'Windows'
67+
run: cmake -DUSE_THIRDPARTY_LIBRARIES=OFF -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/_install "-DCMAKE_TOOLCHAIN_FILE=${Env:VCPKG_INSTALLATION_ROOT}\scripts\buildsystems\vcpkg.cmake" -DCMAKE_DEBUG_POSTFIX=_d -S ${{ github.workspace }} -B ${{ github.workspace }}/_build
68+
69+
- name: "Build Debug"
70+
run: cmake --build ${{ github.workspace }}/_build --config Debug
71+
72+
- name: "Build Release"
73+
run: cmake --build ${{ github.workspace }}/_build --config Release
74+
75+
- name: "Test Debug"
76+
run: ctest -C Debug -V -LE Benchmark
77+
working-directory: "${{ github.workspace }}/_build"
78+
79+
- name: "Test Release"
80+
run: ctest -C Debug -V -LE Benchmark
81+
working-directory: "${{ github.workspace }}/_build"
82+
83+
- name: "Install Debug"
84+
run: cmake --install ${{ github.workspace }}/_build --config Debug
85+
86+
- name: "Install Release"
87+
run: cmake --install ${{ github.workspace }}/_build --config Release
88+
89+
- name: "Configure CMake import for Unix with internal dependencies"
90+
if: matrix.dependencies == 'submodule' && runner.os != 'Windows'
91+
run: cmake -Dprometheus-cpp_DIR=${{ github.workspace }}/_install/lib/cmake/prometheus-cpp -DCMAKE_CONFIGURATION_TYPES='Release;Debug' -G"Ninja Multi-Config" -S ${{ github.workspace }}/cmake/project-import-cmake -B ${{ github.workspace }}/_import_cmake
92+
93+
- name: "Configure CMake import for Windows with internal dependencies"
94+
if: matrix.dependencies == 'submodule' && runner.os == 'Windows'
95+
run: cmake -Dprometheus-cpp_DIR=${{ github.workspace }}/_install/lib/cmake/prometheus-cpp -S ${{ github.workspace }}/cmake/project-import-cmake -B ${{ github.workspace }}/_import_cmake
96+
97+
- name: "Configure CMake import for Unix with vcpkg dependencies"
98+
if: matrix.dependencies == 'vcpkg' && runner.os != 'Windows'
99+
run: cmake -Dprometheus-cpp_DIR=${{ github.workspace }}/_install/lib/cmake/prometheus-cpp "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" -DCMAKE_CONFIGURATION_TYPES='Release;Debug' -G"Ninja Multi-Config" -S ${{ github.workspace }}/cmake/project-import-cmake -B ${{ github.workspace }}/_import_cmake
100+
101+
- name: "Configure CMake import for Windows with vcpkg dependencies"
102+
if: matrix.dependencies == 'vcpkg' && runner.os == 'Windows'
103+
run: cmake -Dprometheus-cpp_DIR=${{ github.workspace }}/_install/lib/cmake/prometheus-cpp "-DCMAKE_TOOLCHAIN_FILE=${Env:VCPKG_INSTALLATION_ROOT}\scripts\buildsystems\vcpkg.cmake" -S ${{ github.workspace }}/cmake/project-import-cmake -B ${{ github.workspace }}/_import_cmake
104+
105+
- name: "Build CMake import Debug"
106+
run: cmake --build ${{ github.workspace }}/_import_cmake --config Debug
107+
108+
- name: "Build CMake import Release"
109+
run: cmake --build ${{ github.workspace }}/_import_cmake --config Release
110+
111+
- name: "Configure for Unix Shared Libs with internal dependencies"
112+
if: matrix.dependencies == 'submodule' && runner.os != 'Windows'
113+
run: cmake -DUSE_THIRDPARTY_LIBRARIES=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/_install_shared -DENABLE_WARNINGS_AS_ERRORS=ON -DENABLE_COMPRESSION=OFF -DENABLE_PUSH=OFF -DCMAKE_DEBUG_POSTFIX=_d -GNinja -S ${{ github.workspace }} -B ${{ github.workspace }}/_build_shared
114+
115+
- name: "Build for Unix Shared Libs"
116+
if: matrix.dependencies == 'submodule' && runner.os != 'Windows'
117+
run: cmake --build ${{ github.workspace }}/_build_shared
118+
119+
- name: "Install for Unix Shared Libs"
120+
if: matrix.dependencies == 'submodule' && runner.os != 'Windows'
121+
run: cmake --install ${{ github.workspace }}/_build_shared
122+
123+
- name: "Configure pkg-config import for Unix"
124+
if: matrix.dependencies == 'submodule' && runner.os != 'Windows'
125+
run: cmake -DCMAKE_PREFIX_PATH=${{ github.workspace }}/_install_shared -GNinja -S ${{ github.workspace }}/cmake/project-import-pkgconfig -B ${{ github.workspace }}/_import_pkgconfig
126+
127+
- name: "Build pkg-config import for Unix"
128+
if: matrix.dependencies == 'submodule' && runner.os != 'Windows'
129+
run: cmake --build ${{ github.workspace }}/_import_pkgconfig

.github/workflows/coverage.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Coverage
2+
on: [push, pull_request]
3+
4+
jobs:
5+
build:
6+
name: Code Coverage
7+
runs-on: ubuntu-20.04
8+
steps:
9+
- name: Checkout source
10+
uses: actions/checkout@v2
11+
12+
- name: Mount vcpkg cache
13+
uses: actions/cache@v2
14+
with:
15+
path: "~/.cache/vcpkg/archives"
16+
key: vcpkg-${{ runner.os }}
17+
18+
- name: Install vcpkg dependencies
19+
run: vcpkg install benchmark civetweb curl[core] gtest zlib
20+
21+
- name: Generate German locale on Ubuntu
22+
if: runner.os == 'Linux'
23+
run: |
24+
sudo apt-get remove -y --purge man-db # avoid time-consuming trigger
25+
sudo apt-get update
26+
sudo apt-get install -y locales
27+
sudo locale-gen de_DE.UTF-8 # used by SerializerTest
28+
29+
- name: Install ninja on Ubuntu
30+
if: runner.os == 'Linux'
31+
run: |
32+
sudo apt-get install -y ninja-build
33+
34+
- name: Install lcov
35+
if: runner.os == 'Linux'
36+
run: |
37+
sudo apt-get install -y lcov
38+
39+
- name: "CMake Configure for Unix with vcpkg dependencies"
40+
env:
41+
CFLAGS: "--coverage"
42+
CXXFLAGS: "--coverage"
43+
LDFLAGS: "--coverage"
44+
run: cmake -DUSE_THIRDPARTY_LIBRARIES=OFF "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" -GNinja -S ${{ github.workspace }} -B ${{ github.workspace }}/_build
45+
46+
- name: Build
47+
run: cmake --build ${{ github.workspace }}/_build
48+
49+
- name: Test
50+
run: ctest -V -LE Benchmark
51+
working-directory: "${{ github.workspace }}/_build"
52+
53+
- name: Run lcov
54+
run: lcov --capture --directory "${{ github.workspace }}/_build" --output-file coverage.info --no-external --directory "${{ github.workspace }}" --exclude '*/tests/*'
55+
56+
- name: Coveralls
57+
uses: coverallsapp/github-action@master
58+
with:
59+
github-token: ${{ secrets.GITHUB_TOKEN }}
60+
path-to-lcov: coverage.info

.github/workflows/doxygen.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Doxygen
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
build:
9+
name: Code Coverage
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- name: Checkout source
13+
uses: actions/checkout@v2
14+
15+
- name: Install doxygen
16+
run: |
17+
sudo apt-get remove -y --purge man-db # avoid time-consuming trigger
18+
sudo apt-get update
19+
sudo apt-get install -y doxygen graphviz
20+
21+
- name: Generate doxygen
22+
run: doxygen
23+
working-directory: "${{ github.workspace }}/doc"
24+
25+
- name: Deploy documentation
26+
uses: peaceiris/actions-gh-pages@v3
27+
with:
28+
github_token: ${{ secrets.GITHUB_TOKEN }}
29+
force_orphan: true
30+
publish_dir: ./doc/html

.github/workflows/linting.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Linting
2+
on: [push, pull_request]
3+
4+
jobs:
5+
iwyu:
6+
name: Include What You Use
7+
runs-on: ubuntu-20.04
8+
steps:
9+
- name: Checkout source
10+
uses: actions/checkout@v2
11+
12+
- name: Checkout submodules
13+
shell: bash
14+
run: |
15+
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
16+
git submodule sync --recursive
17+
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
18+
19+
- name: Install dependencies
20+
run: |
21+
sudo apt-get remove -y --purge man-db # avoid time-consuming trigger
22+
sudo add-apt-repository ppa:gjasny/iwyu
23+
sudo apt-get update
24+
sudo apt-get install -y clang-11 iwyu libbenchmark-dev libcurl4-openssl-dev ninja-build zlib1g-dev
25+
26+
- name: "CMake Configure"
27+
run: cmake -GNinja -DRUN_IWYU=ON -S ${{ github.workspace }} -B ${{ github.workspace }}/_build
28+
29+
- name: Build
30+
run: cmake --build ${{ github.workspace }}/_build 2>&1 | tee ${{ github.workspace }}/output.txt
31+
32+
- name: Check build output
33+
run: if egrep -q 'should (add|remove) these lines' ${{ github.workspace }}/output.txt; then exit 1; fi
34+
35+
#- name: "CMake Configure"
36+
# run: cmake -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -S ${{ github.workspace }} -B ${{ github.workspace }}/_build
37+
38+
#- name: "Run IWYU"
39+
# run: iwyu_tool -p ${{ github.workspace }}/_build core push pull -- -Xiwyu --mapping_file=${{ github.workspace }}/cmake/googletest.imp -Xiwyu --no_fwd_decls 2>&1 | tee ${{ github.workspace }}/output.txt
40+
41+
format:
42+
name: Clang Format
43+
runs-on: ubuntu-20.04
44+
steps:
45+
- name: Checkout source
46+
uses: actions/checkout@v2
47+
48+
- name: Install dependencies
49+
run: |
50+
sudo apt-get remove -y --purge man-db # avoid time-consuming trigger
51+
sudo apt-get update
52+
sudo apt-get install -y clang-format-11
53+
54+
- name: Run clang-format
55+
run: find . -type f \( -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.cxx' -o -name '*.o' -o -name '*.h' -o -name '*.hpp' -o -name '*.hxx' \) -exec clang-format-11 -style=file -i {} \;
56+
57+
- name: Check for changes
58+
run: git diff --exit-code

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
on:
2+
release:
3+
types: [created]
4+
5+
name: Handle Release
6+
7+
jobs:
8+
build:
9+
name: Upload Release Asset
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
15+
- name: Checkout submodules
16+
shell: bash
17+
run: |
18+
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
19+
git submodule sync --recursive
20+
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
21+
22+
- name: Create tarball including submodules
23+
shell: bash
24+
env:
25+
PREFIX: prometheus-cpp-with-submodules
26+
run: |
27+
git archive --prefix "${PREFIX}/" -o "${PREFIX}.tar" HEAD
28+
git submodule foreach --recursive "git archive --prefix=${PREFIX}/\$path/ --output=\$sha1.tar HEAD && tar --concatenate --file=$(pwd)/${PREFIX}.tar \$sha1.tar && rm \$sha1.tar"
29+
gzip "${PREFIX}.tar"
30+
31+
# using the official actions/upload-release-asset action would be preferred but is blocked by
32+
# https://github.com/actions/upload-release-asset/pull/41
33+
- name: Upload the artifacts
34+
uses: skx/github-action-publish-binaries@75ce5546020fc1848da842f40240f9fa03e7a3a8 # release-0.14
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
with:
38+
args: prometheus-cpp-with-submodules.tar.gz

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/bazel-*
2+
cmake-build-*/
3+
_*/
4+
.idea/
5+
doc/html/
6+
.vscode
7+
build

0 commit comments

Comments
 (0)