Skip to content
Draft
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
42 changes: 39 additions & 3 deletions .github/workflows/cargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
required: true
type: string

permissions: {}

jobs:
setup:
name: Setup
Expand Down Expand Up @@ -52,12 +54,15 @@ jobs:
- name: Install Protoc Binary
shell: bash
run: chmod +x ./scripts/install-protoc.sh && ./scripts/install-protoc.sh $HOME
- name: Install Go (required by aws-lc-fips-sys on macOS)
if: inputs.runner == 'macos-14'
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: stable
cache: false
- shell: bash
run: |
if [[ "${{ inputs.runner }}" == "windows-2022" ]]; then
# we don't technially support the datadog-fips crate on windows
# right now anyway, so let's set this so that the windows build
# doesn't fail.
export AWS_LC_FIPS_SYS_NO_ASM=1
fi
cargo clippy --workspace --all-features
Expand All @@ -71,6 +76,12 @@ jobs:
- name: Install Protoc Binary
shell: bash
run: chmod +x ./scripts/install-protoc.sh && ./scripts/install-protoc.sh $HOME
- name: Install Go (required by aws-lc-fips-sys on macOS)
if: inputs.runner == 'macos-14'
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version: stable
cache: false
- shell: bash
run: cargo build --all

Expand Down Expand Up @@ -99,3 +110,28 @@ jobs:
else
cargo nextest run --workspace
fi

bench:
name: Memory Working Set Benchmark
permissions:
contents: write
needs: setup
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Protoc Binary
shell: bash
run: chmod +x ./scripts/install-protoc.sh && ./scripts/install-protoc.sh $HOME
- name: Run memory working set benchmark
shell: bash
run: cargo bench --bench memory_working_set
env:
BENCH_OUTPUT: ${{ github.workspace }}/bench-output.json
- uses: benchmark-action/github-action-benchmark@a60cea5bc7b49e15c1f58f411161f99e0df48372 # v1.22.0
with:
tool: customSmallerIsBetter
output-file-path: ${{ github.workspace }}/bench-output.json
external-data-json-path: ./benchmarks/${{ inputs.runner }}/data.json
github-token: ${{ secrets.GITHUB_TOKEN }}
fail-on-alert: true
alert-threshold: '120%'
4 changes: 3 additions & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ on:

jobs:
cargo:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
runner: [ubuntu-24.04, ubuntu-24.04-arm, windows-2022]
runner: [ubuntu-24.04, ubuntu-24.04-arm, windows-2022, macos-14]
uses: ./.github/workflows/cargo.yml
with:
runner: ${{matrix.runner}}
Expand Down
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions benchmarks/macos-14/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"name":"steady-state-peak-rss","unit":"KB","value":214544}]
1 change: 1 addition & 0 deletions benchmarks/ubuntu-24.04-arm/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"name":"steady-state-peak-rss","unit":"KB","value":217148}]
1 change: 1 addition & 0 deletions benchmarks/ubuntu-24.04/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"name":"steady-state-peak-rss","unit":"KB","value":241640}]
1 change: 1 addition & 0 deletions benchmarks/windows-2022/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"name":"steady-state-peak-rss","unit":"KB","value":98492}]
10 changes: 10 additions & 0 deletions crates/datadog-trace-agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ datadog-fips = { path = "../datadog-fips" }
reqwest = { version = "0.12.23", features = ["json", "http2"], default-features = false }
bytes = "1.10.1"

[[bench]]
name = "memory_working_set"
harness = false

[target.'cfg(not(windows))'.dev-dependencies]
memory-stats = { version = "1.2.0", features = ["always_use_statm"] }

[target.'cfg(windows)'.dev-dependencies]
memory-stats = { version = "1.2.0" }

[dev-dependencies]
rmp-serde = "1.1.1"
serial_test = "2.0.0"
Expand Down
1 change: 1 addition & 0 deletions crates/datadog-trace-agent/bench-output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"name":"steady-state-peak-rss","unit":"KB","value":306745}]
Loading
Loading