diff options
author | Daniel Hanrahan <daniel.hanrahan@est.tech> | 2024-05-28 10:16:20 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2024-05-28 10:16:20 +0000 |
commit | 1e4bf345c21586491ee4767ed9f44de22a99a8c2 (patch) | |
tree | 3a660fba69b3d44331c709ccc0e489fd1b22b970 /k6-tests/ncmp/11-delete-cmhandles.js | |
parent | c69ce470ecabedc9df59b9a9d3888338850fd502 (diff) | |
parent | 0613fbd654bacb9324e07bb2f9f4244302c48aaa (diff) |
Merge "Print summary report for K6 tests"
Diffstat (limited to 'k6-tests/ncmp/11-delete-cmhandles.js')
-rw-r--r-- | k6-tests/ncmp/11-delete-cmhandles.js | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/k6-tests/ncmp/11-delete-cmhandles.js b/k6-tests/ncmp/11-delete-cmhandles.js index daced8ddc8..dabf12cb26 100644 --- a/k6-tests/ncmp/11-delete-cmhandles.js +++ b/k6-tests/ncmp/11-delete-cmhandles.js @@ -21,28 +21,34 @@ import http from 'k6/http'; import exec from 'k6/execution'; import { check } from 'k6'; -import { NCMP_BASE_URL, TOTAL_CM_HANDLES, makeBatchOfCmHandleIds } from './utils.js'; +import { NCMP_BASE_URL, TOTAL_CM_HANDLES, makeBatchOfCmHandleIds, makeCustomSummaryReport } from './utils.js'; const BATCH_SIZE = 100; export const options = { - vus: 1, - iterations: Math.ceil(TOTAL_CM_HANDLES / BATCH_SIZE), - thresholds: { - http_req_failed: ['rate == 0'], - http_req_duration: ['avg <= 1000'], - }, + vus: 1, + iterations: Math.ceil(TOTAL_CM_HANDLES / BATCH_SIZE), + thresholds: { + http_req_failed: ['rate == 0'], + http_req_duration: ['avg <= 1000'], + }, }; -export default function() { +export default function () { const nextBatchOfCmHandleIds = makeBatchOfCmHandleIds(BATCH_SIZE, exec.scenario.iterationInTest); const payload = { "dmiPlugin": "http://ncmp-dmi-plugin-demo-and-csit-stub:8092", "removedCmHandles": nextBatchOfCmHandleIds, }; const response = http.post(NCMP_BASE_URL + '/ncmpInventory/v1/ch', JSON.stringify(payload), { - headers: { 'Content-Type': 'application/json' }, + headers: {'Content-Type': 'application/json'}, }); check(response, { 'status equals 200': (r) => r.status === 200, }); } + +export function handleSummary(data) { + return { + stdout: makeCustomSummaryReport(data, options), + }; +}
\ No newline at end of file |