Skip to content

EX-10318: add metrics for osc.*.state.current_state #390

EX-10318: add metrics for osc.*.state.current_state

EX-10318: add metrics for osc.*.state.current_state #390

on:
push:
branches:
- main
pull_request:
types: [opened, reopened, edited, synchronize]
jobs:
benchmark_scrape_operation:
name: Benchmark Scrape Operation
permissions:
checks: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bencherdev/bencher@main
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run Scrape Memory Metrics Benchmark
run: |
# Run the benchmark first (suppress Criterion output)
cargo bench --bench scrape_memory_metrics 2>&1 > /dev/null
- name: Track scrape memory metrics benchmark on main branch
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: |
bencher run \
--project '${{ secrets.BENCHER_PROJECT_ID }}' \
--token '${{ secrets.BENCHER_API_TOKEN }}' \
--branch main \
--testbed ci-runner \
--threshold-measure peak_rss_mib \
--threshold-test t_test \
--threshold-max-sample-size 64 \
--threshold-lower-boundary 0.95 \
--threshold-upper-boundary 0.95 \
--err \
--adapter json \
--github-actions '${{ secrets.GITHUB_TOKEN }}' \
--file lustrefs-exporter/scrape_allocations_results.json
- name: Compare scrape memory metrics with main branch
if: github.event_name == 'pull_request'
run: |
bencher run \
--project '${{ secrets.BENCHER_PROJECT_ID }}' \
--token '${{ secrets.BENCHER_API_TOKEN }}' \
--branch '${{ github.head_ref }}' \
--start-point main \
--testbed ci-runner \
--start-point-clone-thresholds \
--err \
--adapter json \
--github-actions '${{ secrets.GITHUB_TOKEN }}' \
--file lustrefs-exporter/scrape_allocations_results.json