internal/apps: Refactor and add memory-leak app #2698
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Code generated via `make test-apps.yml`; DO NOT EDIT. | |
name: Test Apps | |
"on": | |
pull_request: {} | |
workflow_call: | |
inputs: | |
ref: | |
description: The branch to run the workflow on | |
required: true | |
type: string | |
'env: prod': | |
type: boolean | |
default: true | |
'env: staging': | |
type: boolean | |
default: true | |
'arg: rps': | |
type: number | |
default: 5 | |
description: Requests per second | |
'arg: scenario_duration': | |
type: number | |
default: 10m | |
description: Scenario duration | |
'arg: profile_period': | |
type: number | |
default: 60s | |
description: Profile period | |
'scenario: unit-of-work/v1': | |
type: boolean | |
default: true | |
'scenario: unit-of-work/v2': | |
type: boolean | |
default: true | |
'scenario: memory-leak/goroutine': | |
type: boolean | |
default: true | |
'scenario: memory-leak/heap': | |
type: boolean | |
default: true | |
'scenario: memory-leak/goroutine-heap': | |
type: boolean | |
default: true | |
workflow_dispatch: | |
inputs: | |
'env: prod': | |
type: boolean | |
default: true | |
'env: staging': | |
type: boolean | |
default: true | |
'arg: rps': | |
type: number | |
default: 5 | |
description: Requests per second | |
'arg: scenario_duration': | |
type: number | |
default: 10m | |
description: Scenario duration | |
'arg: profile_period': | |
type: number | |
default: 60s | |
description: Profile period | |
'scenario: unit-of-work/v1': | |
type: boolean | |
default: false | |
'scenario: unit-of-work/v2': | |
type: boolean | |
default: false | |
'scenario: memory-leak/goroutine': | |
type: boolean | |
default: false | |
'scenario: memory-leak/heap': | |
type: boolean | |
default: false | |
'scenario: memory-leak/goroutine-heap': | |
type: boolean | |
default: false | |
env: | |
DD_ENV: github | |
DD_TAGS: github_run_id:${{ github.run_id }} github_run_number:${{ github.run_number }} | |
jobs: | |
job-0-0: | |
name: unit-of-work/v1 (prod) | |
runs-on: ubuntu-latest | |
if: 'inputs[''scenario: unit-of-work/v1''] && inputs[''env: prod''] && (github.event_name != ''pull_request'' || github.event.pull_request.head.repo.full_name == ''DataDog/dd-trace-go'')' | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ inputs.ref || github.ref }} | |
- name: Start Agent | |
uses: datadog/agent-github-action@v1.3 | |
with: | |
api_key: ${{ secrets['DD_TEST_APP_API_KEY'] }} | |
datadog_site: datadoghq.com | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: stable | |
check-latest: true | |
cache: true | |
- name: Run Scenario | |
env: | |
DD_TEST_APPS_REQUESTS_PER_SECOND: '${{ inputs[''arg: rps''] || ''5'' }}' | |
DD_TEST_APPS_TOTAL_DURATION: '${{ inputs[''arg: scenario_duration''] || ''60s'' }}' | |
DD_TEST_APPS_PROFILE_PERIOD: '${{ inputs[''arg: profile_period''] || ''10s'' }}' | |
run: cd ./internal/apps && ./run-scenario.bash 'unit-of-work/v1' | |
job-0-1: | |
name: unit-of-work/v1 (staging) | |
runs-on: ubuntu-latest | |
if: 'inputs[''scenario: unit-of-work/v1''] && inputs[''env: staging''] && (github.event_name != ''pull_request'' || github.event.pull_request.head.repo.full_name == ''DataDog/dd-trace-go'')' | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ inputs.ref || github.ref }} | |
- name: Start Agent | |
uses: datadog/agent-github-action@v1.3 | |
with: | |
api_key: ${{ secrets['DD_TEST_AND_DEMO_API_KEY'] }} | |
datadog_site: datad0g.com | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: stable | |
check-latest: true | |
cache: true | |
- name: Run Scenario | |
env: | |
DD_TEST_APPS_REQUESTS_PER_SECOND: '${{ inputs[''arg: rps''] || ''5'' }}' | |
DD_TEST_APPS_TOTAL_DURATION: '${{ inputs[''arg: scenario_duration''] || ''60s'' }}' | |
DD_TEST_APPS_PROFILE_PERIOD: '${{ inputs[''arg: profile_period''] || ''10s'' }}' | |
run: cd ./internal/apps && ./run-scenario.bash 'unit-of-work/v1' | |
job-1-0: | |
name: unit-of-work/v2 (prod) | |
runs-on: ubuntu-latest | |
if: 'inputs[''scenario: unit-of-work/v2''] && inputs[''env: prod''] && (github.event_name != ''pull_request'' || github.event.pull_request.head.repo.full_name == ''DataDog/dd-trace-go'')' | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ inputs.ref || github.ref }} | |
- name: Start Agent | |
uses: datadog/agent-github-action@v1.3 | |
with: | |
api_key: ${{ secrets['DD_TEST_APP_API_KEY'] }} | |
datadog_site: datadoghq.com | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: stable | |
check-latest: true | |
cache: true | |
- name: Run Scenario | |
env: | |
DD_TEST_APPS_REQUESTS_PER_SECOND: '${{ inputs[''arg: rps''] || ''5'' }}' | |
DD_TEST_APPS_TOTAL_DURATION: '${{ inputs[''arg: scenario_duration''] || ''60s'' }}' | |
DD_TEST_APPS_PROFILE_PERIOD: '${{ inputs[''arg: profile_period''] || ''10s'' }}' | |
run: cd ./internal/apps && ./run-scenario.bash 'unit-of-work/v2' | |
job-1-1: | |
name: unit-of-work/v2 (staging) | |
runs-on: ubuntu-latest | |
if: 'inputs[''scenario: unit-of-work/v2''] && inputs[''env: staging''] && (github.event_name != ''pull_request'' || github.event.pull_request.head.repo.full_name == ''DataDog/dd-trace-go'')' | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ inputs.ref || github.ref }} | |
- name: Start Agent | |
uses: datadog/agent-github-action@v1.3 | |
with: | |
api_key: ${{ secrets['DD_TEST_AND_DEMO_API_KEY'] }} | |
datadog_site: datad0g.com | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: stable | |
check-latest: true | |
cache: true | |
- name: Run Scenario | |
env: | |
DD_TEST_APPS_REQUESTS_PER_SECOND: '${{ inputs[''arg: rps''] || ''5'' }}' | |
DD_TEST_APPS_TOTAL_DURATION: '${{ inputs[''arg: scenario_duration''] || ''60s'' }}' | |
DD_TEST_APPS_PROFILE_PERIOD: '${{ inputs[''arg: profile_period''] || ''10s'' }}' | |
run: cd ./internal/apps && ./run-scenario.bash 'unit-of-work/v2' | |
job-2-0: | |
name: memory-leak/goroutine (prod) | |
runs-on: ubuntu-latest | |
if: 'inputs[''scenario: memory-leak/goroutine''] && inputs[''env: prod''] && (github.event_name != ''pull_request'' || github.event.pull_request.head.repo.full_name == ''DataDog/dd-trace-go'')' | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ inputs.ref || github.ref }} | |
- name: Start Agent | |
uses: datadog/agent-github-action@v1.3 | |
with: | |
api_key: ${{ secrets['DD_TEST_APP_API_KEY'] }} | |
datadog_site: datadoghq.com | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: stable | |
check-latest: true | |
cache: true | |
- name: Run Scenario | |
env: | |
DD_TEST_APPS_REQUESTS_PER_SECOND: '${{ inputs[''arg: rps''] || ''5'' }}' | |
DD_TEST_APPS_TOTAL_DURATION: '${{ inputs[''arg: scenario_duration''] || ''60s'' }}' | |
DD_TEST_APPS_PROFILE_PERIOD: '${{ inputs[''arg: profile_period''] || ''10s'' }}' | |
run: cd ./internal/apps && ./run-scenario.bash 'memory-leak/goroutine' | |
job-2-1: | |
name: memory-leak/goroutine (staging) | |
runs-on: ubuntu-latest | |
if: 'inputs[''scenario: memory-leak/goroutine''] && inputs[''env: staging''] && (github.event_name != ''pull_request'' || github.event.pull_request.head.repo.full_name == ''DataDog/dd-trace-go'')' | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ inputs.ref || github.ref }} | |
- name: Start Agent | |
uses: datadog/agent-github-action@v1.3 | |
with: | |
api_key: ${{ secrets['DD_TEST_AND_DEMO_API_KEY'] }} | |
datadog_site: datad0g.com | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: stable | |
check-latest: true | |
cache: true | |
- name: Run Scenario | |
env: | |
DD_TEST_APPS_REQUESTS_PER_SECOND: '${{ inputs[''arg: rps''] || ''5'' }}' | |
DD_TEST_APPS_TOTAL_DURATION: '${{ inputs[''arg: scenario_duration''] || ''60s'' }}' | |
DD_TEST_APPS_PROFILE_PERIOD: '${{ inputs[''arg: profile_period''] || ''10s'' }}' | |
run: cd ./internal/apps && ./run-scenario.bash 'memory-leak/goroutine' | |
job-3-0: | |
name: memory-leak/heap (prod) | |
runs-on: ubuntu-latest | |
if: 'inputs[''scenario: memory-leak/heap''] && inputs[''env: prod''] && (github.event_name != ''pull_request'' || github.event.pull_request.head.repo.full_name == ''DataDog/dd-trace-go'')' | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ inputs.ref || github.ref }} | |
- name: Start Agent | |
uses: datadog/agent-github-action@v1.3 | |
with: | |
api_key: ${{ secrets['DD_TEST_APP_API_KEY'] }} | |
datadog_site: datadoghq.com | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: stable | |
check-latest: true | |
cache: true | |
- name: Run Scenario | |
env: | |
DD_TEST_APPS_REQUESTS_PER_SECOND: '${{ inputs[''arg: rps''] || ''5'' }}' | |
DD_TEST_APPS_TOTAL_DURATION: '${{ inputs[''arg: scenario_duration''] || ''60s'' }}' | |
DD_TEST_APPS_PROFILE_PERIOD: '${{ inputs[''arg: profile_period''] || ''10s'' }}' | |
run: cd ./internal/apps && ./run-scenario.bash 'memory-leak/heap' | |
job-3-1: | |
name: memory-leak/heap (staging) | |
runs-on: ubuntu-latest | |
if: 'inputs[''scenario: memory-leak/heap''] && inputs[''env: staging''] && (github.event_name != ''pull_request'' || github.event.pull_request.head.repo.full_name == ''DataDog/dd-trace-go'')' | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ inputs.ref || github.ref }} | |
- name: Start Agent | |
uses: datadog/agent-github-action@v1.3 | |
with: | |
api_key: ${{ secrets['DD_TEST_AND_DEMO_API_KEY'] }} | |
datadog_site: datad0g.com | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: stable | |
check-latest: true | |
cache: true | |
- name: Run Scenario | |
env: | |
DD_TEST_APPS_REQUESTS_PER_SECOND: '${{ inputs[''arg: rps''] || ''5'' }}' | |
DD_TEST_APPS_TOTAL_DURATION: '${{ inputs[''arg: scenario_duration''] || ''60s'' }}' | |
DD_TEST_APPS_PROFILE_PERIOD: '${{ inputs[''arg: profile_period''] || ''10s'' }}' | |
run: cd ./internal/apps && ./run-scenario.bash 'memory-leak/heap' | |
job-4-0: | |
name: memory-leak/goroutine-heap (prod) | |
runs-on: ubuntu-latest | |
if: 'inputs[''scenario: memory-leak/goroutine-heap''] && inputs[''env: prod''] && (github.event_name != ''pull_request'' || github.event.pull_request.head.repo.full_name == ''DataDog/dd-trace-go'')' | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ inputs.ref || github.ref }} | |
- name: Start Agent | |
uses: datadog/agent-github-action@v1.3 | |
with: | |
api_key: ${{ secrets['DD_TEST_APP_API_KEY'] }} | |
datadog_site: datadoghq.com | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: stable | |
check-latest: true | |
cache: true | |
- name: Run Scenario | |
env: | |
DD_TEST_APPS_REQUESTS_PER_SECOND: '${{ inputs[''arg: rps''] || ''5'' }}' | |
DD_TEST_APPS_TOTAL_DURATION: '${{ inputs[''arg: scenario_duration''] || ''60s'' }}' | |
DD_TEST_APPS_PROFILE_PERIOD: '${{ inputs[''arg: profile_period''] || ''10s'' }}' | |
run: cd ./internal/apps && ./run-scenario.bash 'memory-leak/goroutine-heap' | |
job-4-1: | |
name: memory-leak/goroutine-heap (staging) | |
runs-on: ubuntu-latest | |
if: 'inputs[''scenario: memory-leak/goroutine-heap''] && inputs[''env: staging''] && (github.event_name != ''pull_request'' || github.event.pull_request.head.repo.full_name == ''DataDog/dd-trace-go'')' | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ inputs.ref || github.ref }} | |
- name: Start Agent | |
uses: datadog/agent-github-action@v1.3 | |
with: | |
api_key: ${{ secrets['DD_TEST_AND_DEMO_API_KEY'] }} | |
datadog_site: datad0g.com | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: stable | |
check-latest: true | |
cache: true | |
- name: Run Scenario | |
env: | |
DD_TEST_APPS_REQUESTS_PER_SECOND: '${{ inputs[''arg: rps''] || ''5'' }}' | |
DD_TEST_APPS_TOTAL_DURATION: '${{ inputs[''arg: scenario_duration''] || ''60s'' }}' | |
DD_TEST_APPS_PROFILE_PERIOD: '${{ inputs[''arg: profile_period''] || ''10s'' }}' | |
run: cd ./internal/apps && ./run-scenario.bash 'memory-leak/goroutine-heap' |