Skip to content

Commit

Permalink
chore(performance): Adjust thresholds (#1870)
Browse files Browse the repository at this point in the history
<!--- Provide a general summary of your changes in the Title above -->

## Description

Adjust smoketests thresholds for p95 and removed thresholds for p99.
Use k8s k6 operator cluster instead of github runner

## Related Issue(s)

- #1862 

## Verification

- [ ] **Your** code builds clean without any errors or warnings
- [ ] Manual testing done (required)
- [ ] Relevant automated test added (if you find this hard, leave it and
we'll help out)

## Documentation

- [ ] Documentation is updated (either in `docs`-directory, Altinnpedia
or a separate linked PR in
[altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if
applicable)
  • Loading branch information
dagfinno authored Feb 13, 2025
1 parent 09b3722 commit 3e6e3b9
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 25 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci-cd-yt01.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ jobs:
if: ${{ always() && !failure() && !cancelled() && (needs.check-for-changes.outputs.hasBackendChanges == 'true' || needs.check-for-changes.outputs.hasInfraChanges == 'true') }}
needs: [deploy-apps, deploy-infra, check-for-changes]
#needs: [deploy-apps, check-for-changes]
uses: ./.github/workflows/workflow-run-k6-ci-cd-yt01.yml
uses: ./.github/workflows/workflow-run-k6-performance.yml
secrets:
TOKEN_GENERATOR_USERNAME: ${{ secrets.TOKEN_GENERATOR_USERNAME }}
TOKEN_GENERATOR_PASSWORD: ${{ secrets.TOKEN_GENERATOR_PASSWORD }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
strategy:
max-parallel: 1
matrix:
Expand All @@ -133,6 +133,9 @@ jobs:
vus: 1
duration: 30s
testSuitePath: ${{ matrix.files }}
parallelism: 1
breakpoint: false
abortOnFail: false
ref: "refs/tags/v${{ github.event.client_payload.version }}"
permissions:
checks: write
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/workflow-run-k6-performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ on:
abortOnFail:
required: true
type: boolean
ref:
description: "The branch or tag ref to run the tests on. Using default checkout ref if not provided."
required: false
default: ${{ github.ref }}
type: string
secrets:
AZURE_CLIENT_ID:
required: true
Expand All @@ -42,6 +47,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: OIDC Login to Azure Public Cloud
uses: azure/login@v2
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ export let options = {
duration: "30s",
thresholds: {
..._options.thresholds,
"http_req_duration{name:enduser search}": ["p(95)<300", "p(99)<500"],
"http_req_duration{name:get dialog}": ["p(95)<300", "p(99)<500"],
"http_req_duration{name:get dialog activities}": ["p(95)<300", "p(99)<500"],
"http_req_duration{name:get dialog activity}": ["p(95)<300", "p(99)<500"],
"http_req_duration{name:get seenlogs}": ["p(95)<300", "p(99)<500"],
"http_req_duration{name:get seenlog}": ["p(95)<300", "p(99)<500"],
"http_req_duration{name:get transmissions}": ["p(95)<300", "p(99)<500"],
"http_req_duration{name:get transmission}": ["p(95)<300", "p(99)<500"],
"http_req_duration{name:get labellog}": ["p(95)<300", "p(99)<500"]
"http_req_duration{name:enduser search}": ["p(95)<300"],
"http_req_duration{name:get dialog}": ["p(95)<300"],
"http_req_duration{name:get dialog activities}": ["p(95)<300"],
"http_req_duration{name:get dialog activity}": ["p(95)<300"],
"http_req_duration{name:get seenlogs}": ["p(95)<300"],
"http_req_duration{name:get seenlog}": ["p(95)<300"],
"http_req_duration{name:get transmissions}": ["p(95)<300"],
"http_req_duration{name:get transmission}": ["p(95)<300"],
"http_req_duration{name:get labellog}": ["p(95)<300"]
}
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import { default as run } from "./create-dialog.js";
export { setup as setup } from '../../performancetest_common/readTestdata.js';

import { randomItem } from '../../../common/k6-utils.js';
import { createDialog } from '../../performancetest_common/createDialog.js';
import { serviceOwners, endUsers } from '../../performancetest_common/readTestdata.js';
export let options = {
summaryTrendStats: ['avg', 'min', 'med', 'max', 'p(95)', 'p(99)', 'p(99.5)', 'p(99.9)', 'count'],
vus: 1,
duration: "30s",
thresholds: {
"http_req_duration{name:create dialog}": ["p(95)<300", "p(99)<500"],
"http_req_duration{name:create dialog}": ["p(95)<200"],
"http_reqs{name:create dialog}": []
}
}

export default function (data) { run(data); }
const traceCalls = (__ENV.traceCalls ?? 'false') === 'true';

export default function () {
createDialog(serviceOwners[0], randomItem(endUsers), traceCalls);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { randomItem } from '../../../common/k6-utils.js';
import { createTransmissions } from '../../performancetest_common/createDialog.js';
import { serviceOwners, endUsers } from '../../performancetest_common/readTestdata.js';

export const options = {
summaryTrendStats: ['avg', 'min', 'med', 'max', 'p(95)', 'p(99)', 'p(99.5)', 'p(99.9)', 'count'],
vus: 1,
duration: "30s",
thresholds: {
"http_req_duration{name:create dialog}": ["p(95)<200"],
"http_reqs{name:create dialog}": [],
"http_req_duration{name:create transmission}": ["p(95)<200"],
"http_reqs{name:create transmission}": []
}
};

const traceCalls = (__ENV.traceCalls ?? 'false') === 'true';
const numberOfTransmissions = (__ENV.numberOfTransmissions ?? '10');
const maxTransmissionsInThread = (__ENV.maxTransmissionsInThread ?? '100');
const testid = (__ENV.TESTID ?? 'createTransmissions');

export default function() {
createTransmissions(serviceOwners[0], randomItem(endUsers), traceCalls, numberOfTransmissions, maxTransmissionsInThread, testid);
}

Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ export let options = {
duration: "30s",
thresholds: {
..._options.thresholds,
"http_req_duration{name:serviceowner search}": ["p(95)<100", "p(99)<300"],
"http_req_duration{name:get dialog}": ["p(95)<100", "p(99)<300"],
"http_req_duration{name:get dialog activities}": ["p(95)<100", "p(99)<300"],
"http_req_duration{name:get dialog activity}": ["p(95)<100", "p(99)<300"],
"http_req_duration{name:get seenlogs}": ["p(95)<100", "p(99)<300"],
"http_req_duration{name:get seenlog}": ["p(95)<100", "p(99)<300"],
"http_req_duration{name:get transmissions}": ["p(95)<100", "p(99)<300"],
"http_req_duration{name:get transmission}": ["p(95)<100", "p(99)<300"],
"http_req_duration{name:serviceowner search}": ["p(95)<300"],
"http_req_duration{name:get dialog}": ["p(95)<300"],
"http_req_duration{name:get dialog activities}": ["p(95)<300"],
"http_req_duration{name:get dialog activity}": ["p(95)<300"],
"http_req_duration{name:get seenlogs}": ["p(95)<300"],
"http_req_duration{name:get seenlog}": ["p(95)<300"],
"http_req_duration{name:get transmissions}": ["p(95)<300"],
"http_req_duration{name:get transmission}": ["p(95)<300"],
}
}

Expand Down

0 comments on commit 3e6e3b9

Please sign in to comment.