Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions docs/src/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,27 @@ DaemonEye requires elevated privileges for process monitoring. The system is des
1. **Download the latest release**:

```bash
# Linux
wget https://github.com/daemoneye/daemoneye/releases/latest/download/daemoneye-linux-x86_64.tar.gz
tar -xzf daemoneye-linux-x86_64.tar.gz
# Linux (x86_64)
wget https://github.com/EvilBit-Labs/DaemonEye/releases/latest/download/DaemonEye_Linux_x86_64.tar.gz
tar -xzf DaemonEye_Linux_x86_64.tar.gz

# macOS
curl -L https://github.com/daemoneye/daemoneye/releases/latest/download/daemoneye-macos-x86_64.tar.gz | tar -xz
# Linux (ARM64)
wget https://github.com/EvilBit-Labs/DaemonEye/releases/latest/download/DaemonEye_Linux_aarch64.tar.gz
tar -xzf DaemonEye_Linux_aarch64.tar.gz

# Windows
# Download and extract from GitHub releases
# macOS (Intel)
curl -L https://github.com/EvilBit-Labs/DaemonEye/releases/latest/download/DaemonEye_Darwin_x86_64.tar.gz | tar -xz

# macOS (Apple Silicon)
curl -L https://github.com/EvilBit-Labs/DaemonEye/releases/latest/download/DaemonEye_Darwin_aarch64.tar.gz | tar -xz

# Windows (x86_64)
# Download https://github.com/EvilBit-Labs/DaemonEye/releases/latest/download/DaemonEye_Windows_x86_64.zip
# Extract the ZIP file

# Windows (ARM64)
# Download https://github.com/EvilBit-Labs/DaemonEye/releases/latest/download/DaemonEye_Windows_aarch64.zip
# Extract the ZIP file
```

2. **Install to system directories**:
Expand Down
176 changes: 152 additions & 24 deletions docs/src/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,18 @@ async fn test_full_system_workflow() {

## Performance Testing

### Automated CI Benchmarks

DaemonEye's CI pipeline includes automated performance benchmarking to detect regressions:

- **Automatic Execution**: Performance benchmarks run on every CI build using Criterion
- **Regression Detection**: Tests automatically detect performance regressions with a 10% threshold
- **Baseline Comparison**: Benchmark results are cached and compared against baseline from the main branch
- **Load Testing**: Automated load tests validate system behavior under stress
- **Results Archival**: Benchmark results are uploaded as artifacts with 30-day retention

Developers can access benchmark results from the GitHub Actions workflow artifacts. If a performance regression exceeds the 10% threshold, the CI build will fail with a detailed error message showing which benchmarks regressed.

### Load Testing

Test system performance under load:
Expand Down Expand Up @@ -654,6 +666,8 @@ impl TestDataManager {

### GitHub Actions Workflow

The CI pipeline includes multiple jobs that run on every build:

```yaml
name: Tests

Expand All @@ -664,48 +678,162 @@ on:
branches: [main]

jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: jdx/mise-action@v3
with:
install: true
cache: true
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Ensure rustfmt and clippy are installed
run: rustup component add rustfmt clippy

- name: Check formatting
run: just lint-rust

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: jdx/mise-action@v3
with:
install: true
cache: true
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Run tests (all features)
run: mise x -- cargo nextest run --profile ci --all-features

- name: Build release
run: mise x -- cargo build --release --all-features

test-cross-platform:
strategy:
matrix:
rust: [1.87, stable, beta]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
needs: quality
steps:
- uses: actions/checkout@v6
- uses: jdx/mise-action@v3
with:
install: true
cache: true
github_token: ${{ secrets.GITHUB_TOKEN }}

- run: mise x -- cargo nextest run --profile ci --all-features
- run: mise x -- cargo build --release --all-features

coverage:
runs-on: ubuntu-latest
needs: [test, test-cross-platform, quality]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
- uses: jdx/mise-action@v3
with:
install: true
cache: true
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Install Rust
uses: actions-rs/toolchain@v1
- name: Generate coverage
run: mise x -- cargo llvm-cov --all-features --no-report

- name: Combine coverage reports
run: mise x -- cargo llvm-cov report --lcov --output-path lcov.info

- name: Upload to Codecov
uses: codecov/codecov-action@v5
with:
toolchain: ${{ matrix.rust }}
override: true
files: lcov.info
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libsqlite3-dev
benchmarks:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Run tests
run: |
cargo test --verbose
cargo test --verbose --features integration-tests
- uses: jdx/mise-action@v3
with:
install: true
cache: true
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Restore baseline benchmarks
uses: actions/cache/restore@v4
with:
path: target/criterion
key: criterion-baseline-${{ runner.os }}

- name: Run benchmarks
run: cargo bench --verbose
run: mise x -- cargo bench --package procmond 2>&1 | tee
bench-output.txt

- name: Run fuzz tests
- name: Check for performance regression
run: |
cargo install cargo-fuzz
cargo fuzz build
cargo fuzz run process_info
cargo fuzz run sql_query
# Criterion reports "regressed" when performance degrades beyond noise threshold.
# Fail CI if any benchmark regresses more than 10%.
if grep -q "Performance has regressed" bench-output.txt; then
echo "::warning::Performance regression detected in benchmarks"
grep -A2 "Performance has regressed" bench-output.txt
if grep -oP 'change: \+\K[0-9.]+' bench-output.txt | awk '{if ($1 > 10.0) exit 1}'; then
echo "All regressions within 10% threshold"
else
echo "::error::Benchmark regression exceeds 10% threshold"
exit 1
fi
else
echo "No performance regressions detected"
fi

- name: Save baseline benchmarks
uses: actions/cache/save@v4
if: github.ref == 'refs/heads/main'
with:
path: target/criterion
key: criterion-baseline-${{ runner.os }}

- name: Generate coverage report
run: |
cargo install cargo-tarpaulin
cargo tarpaulin --out Html --output-dir coverage
- name: Run load tests
run: NO_COLOR=1 TERM=dumb mise x -- cargo test --package procmond --test
load_tests -- --ignored --nocapture 2>&1 | tee load-test-output.txt

- name: Upload benchmark results
uses: actions/upload-artifact@v4
if: always()
with:
name: benchmark-results
path: |
bench-output.txt
load-test-output.txt
retention-days: 30
```

### CI Jobs Overview

The CI pipeline includes the following jobs:

1. **quality**: Runs code formatting and linting checks
2. **test**: Executes the full test suite with all features enabled
3. **test-cross-platform**: Tests on Ubuntu, macOS, and Windows
4. **coverage**: Generates and uploads code coverage reports
5. **benchmarks**: Runs performance benchmarks with regression detection

### Accessing Benchmark Results

Benchmark results are available in multiple ways:

- **Workflow Artifacts**: Download `benchmark-results` artifacts from the GitHub Actions workflow summary page
- **CI Logs**: View benchmark output directly in the workflow logs under the "Run benchmarks" step
- **Performance Alerts**: If a regression exceeds 10%, the CI build will fail with a warning annotation showing which benchmarks regressed

The `benchmarks` job stores baseline results from the `main` branch and compares all subsequent runs against this baseline to detect performance regressions.

### Test Reporting

```rust,ignore
Expand Down
15 changes: 4 additions & 11 deletions mise.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# @generated - this file is auto-generated by `mise lock` https://mise.jdx.dev/dev-tools/mise-lock.html

[[tools.actionlint]]
version = "1.7.10"
backend = "aqua:rhysd/actionlint"
Expand Down Expand Up @@ -167,18 +169,9 @@ backend = "pipx:mdformat"
[tools."pipx:mdformat".options]
uvx_args = "--with mdformat-gfm --with mdformat-frontmatter --with mdformat-footnote --with mdformat-simple-breaks --with mdformat-gfm-alerts --with mdformat-toc --with mdformat-wikilink --with mdformat-tables"

[[tools.pre-commit]]
[[tools."pipx:pre-commit"]]
version = "4.5.1"
backend = "aqua:pre-commit/pre-commit"
"platforms.linux-arm64" = { checksum = "sha256:19d00ba35cbf9c04dc3736cd8bb641e8633f3eddd4cedde71809574ae68a2cd1", url = "https://github.com/pre-commit/pre-commit/releases/download/v4.5.1/pre-commit-4.5.1.pyz"}
"platforms.linux-arm64-musl" = { checksum = "sha256:19d00ba35cbf9c04dc3736cd8bb641e8633f3eddd4cedde71809574ae68a2cd1", url = "https://github.com/pre-commit/pre-commit/releases/download/v4.5.1/pre-commit-4.5.1.pyz"}
"platforms.linux-x64" = { checksum = "sha256:19d00ba35cbf9c04dc3736cd8bb641e8633f3eddd4cedde71809574ae68a2cd1", url = "https://github.com/pre-commit/pre-commit/releases/download/v4.5.1/pre-commit-4.5.1.pyz"}
"platforms.linux-x64-baseline" = { checksum = "sha256:19d00ba35cbf9c04dc3736cd8bb641e8633f3eddd4cedde71809574ae68a2cd1", url = "https://github.com/pre-commit/pre-commit/releases/download/v4.5.1/pre-commit-4.5.1.pyz"}
"platforms.linux-x64-musl" = { checksum = "sha256:19d00ba35cbf9c04dc3736cd8bb641e8633f3eddd4cedde71809574ae68a2cd1", url = "https://github.com/pre-commit/pre-commit/releases/download/v4.5.1/pre-commit-4.5.1.pyz"}
"platforms.linux-x64-musl-baseline" = { checksum = "sha256:19d00ba35cbf9c04dc3736cd8bb641e8633f3eddd4cedde71809574ae68a2cd1", url = "https://github.com/pre-commit/pre-commit/releases/download/v4.5.1/pre-commit-4.5.1.pyz"}
"platforms.macos-arm64" = { checksum = "sha256:19d00ba35cbf9c04dc3736cd8bb641e8633f3eddd4cedde71809574ae68a2cd1", url = "https://github.com/pre-commit/pre-commit/releases/download/v4.5.1/pre-commit-4.5.1.pyz"}
"platforms.macos-x64" = { checksum = "sha256:19d00ba35cbf9c04dc3736cd8bb641e8633f3eddd4cedde71809574ae68a2cd1", url = "https://github.com/pre-commit/pre-commit/releases/download/v4.5.1/pre-commit-4.5.1.pyz"}
"platforms.macos-x64-baseline" = { checksum = "sha256:19d00ba35cbf9c04dc3736cd8bb641e8633f3eddd4cedde71809574ae68a2cd1", url = "https://github.com/pre-commit/pre-commit/releases/download/v4.5.1/pre-commit-4.5.1.pyz"}
backend = "pipx:pre-commit"

[[tools.prettier]]
version = "3.8.1"
Expand Down
4 changes: 2 additions & 2 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ actionlint = "1.7.10"
lychee = "0.22.0"
markdownlint-cli2 = "0.20.0"
protobuf = "33.4"
pre-commit = "4.5.1"
protoc = "33.4"
zig = "latest"
"cargo:cargo-zigbuild" = "latest"
bun = "latest"
goreleaser = "latest"
goreleaser = "latest"
"pipx:pre-commit" = "latest"

# Many of these settings are defaults, but we are explicit in case they change in the future and to make it clear to users what is enabled.
[settings]
Expand Down
4 changes: 2 additions & 2 deletions procmond/benches/process_collector_benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ fn bench_real_collectors_high_counts(c: &mut Criterion) {

// Set longer measurement time for real collectors
group.measurement_time(Duration::from_secs(60));
group.sample_size(5);
group.sample_size(10);

// Test configurations for high process counts
let high_count_configs = vec![
Expand Down Expand Up @@ -679,7 +679,7 @@ fn bench_memory_efficiency_high_counts(c: &mut Criterion) {

// Set parameters for memory efficiency testing
group.measurement_time(Duration::from_secs(45));
group.sample_size(5);
group.sample_size(10);

// Test memory efficiency with extremely high process counts
for process_count in [50000, 100000, 200000].iter() {
Expand Down
Loading