Skip to content

Commit

Permalink
WIP Introduce xcp-metrics-plugin-squeezed plugin for xcp-rrdd
Browse files Browse the repository at this point in the history
xcp-metrics-plugin-squeezed is meant as a drop-in replacement for
rrdp-squeezed, as a first Rust-written brick for XAPI.

Metrics are read in Xenstore using the xenstore-rs bindings of
libxenstore, structured in a suitable way for upcoming OpenMetrics
support, and communicated to xcp-rrdd using its v2 protocol.

NOTE: while the full xcp-metrics work currently references external
git repository for xenstore-rs and xenctrl-rs as we had to add some
features there and the PRs are still pending, this initial work
explicitly does ot require any of those, and we went into some
gymnastics to support this, which reflects in the scripts extracting
this PR source code, as well as in parts of the code itself.

Signed-off-by: Teddy Astie <[email protected]>
Reviewed-by: Yann Dirson <[email protected]>
  • Loading branch information
TSnake41 authored and ydirson committed Oct 2, 2023
0 parents commit a150576
Show file tree
Hide file tree
Showing 60 changed files with 8,811 additions and 0 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Rust

on:
push:
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest
#container:
# image: centos8

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.70.0
override: true
- name: Installing dependency packages
run: sudo apt update && sudo apt install -y libxen-dev protobuf-compiler

- name: Build
run: cargo build --verbose

doc:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.70.0
override: true
- name: Installing dependency packages
run: sudo apt update && sudo apt install -y libxen-dev protobuf-compiler

- name: Build docs
run: cargo doc --workspace --no-deps

- name: Upload docs
uses: actions/upload-artifact@v3
with:
name: rustdoc-html
path: ./target/doc

test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Installing dependency packages
run: sudo apt update && sudo apt install -y libxen-dev protobuf-compiler

- name: Run tests
run: |
cargo clean
cargo test --verbose
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'

- name: Install grcov
run: cargo install grcov
- name: Test coverage report
run: grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./target/debug/coverage/

- name: Upload test coverage report
uses: actions/upload-artifact@v3
with:
name: coverage-html
path: ./target/debug/coverage/
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target
/third-party/
Loading

0 comments on commit a150576

Please sign in to comment.