From fcc81ee3a4b9ae937e0f447ee574b676506b6390 Mon Sep 17 00:00:00 2001 From: "halil.cakal" Date: Thu, 11 Jul 2024 14:54:57 +0100 Subject: Add passthrough write (CUD) operations to k6 - the delay for dmi has been hanlded in seprate commit - for simplicity only the POST request is considered Issue-ID: CPS-2267 Change-Id: I62ede04dd8e2744fc723566742396df31c42ea5d Signed-off-by: halil.cakal --- k6-tests/ncmp/ncmp-kpi.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'k6-tests/ncmp/ncmp-kpi.js') diff --git a/k6-tests/ncmp/ncmp-kpi.js b/k6-tests/ncmp/ncmp-kpi.js index 91a38d99ce..24fbef0bfc 100644 --- a/k6-tests/ncmp/ncmp-kpi.js +++ b/k6-tests/ncmp/ncmp-kpi.js @@ -23,7 +23,7 @@ import { Gauge } from 'k6/metrics'; import { TOTAL_CM_HANDLES, makeCustomSummaryReport, recordTimeInSeconds } from './common/utils.js'; import { registerAllCmHandles, deregisterAllCmHandles } from './common/cmhandle-crud.js'; import { executeCmHandleSearch, executeCmHandleIdSearch } from './common/search-base.js'; -import { passthroughRead } from './common/passthrough-read.js'; +import { passthroughRead, passthroughWrite } from './common/passthrough-crud.js'; let cmHandlesCreatedPerSecondGauge = new Gauge('cmhandles_created_per_second'); let cmHandlesDeletedPerSecondGauge = new Gauge('cmhandles_deleted_per_second'); @@ -40,6 +40,12 @@ export const options = { vus: 10, duration: DURATION, }, + passthrough_write: { + executor: 'constant-vus', + exec: 'passthrough_write', + vus: 10, + duration: DURATION, + }, id_search_module: { executor: 'constant-vus', exec: 'id_search_module', @@ -57,6 +63,7 @@ export const options = { 'cmhandles_created_per_second': ['value >= 22'], 'cmhandles_deleted_per_second': ['value >= 22'], 'http_req_failed{scenario:passthrough_read}': ['rate == 0'], + 'http_reqs{scenario:passthrough_write}': ['rate >= 13'], 'http_req_failed{scenario:id_search_module}': ['rate == 0'], 'http_req_failed{scenario:cm_search_module}': ['rate == 0'], 'http_req_duration{scenario:passthrough_read}': ['avg <= 2600'], // DMI delay + 100 ms @@ -80,6 +87,11 @@ export function passthrough_read() { check(response, { 'passthrough read status equals 200': (r) => r.status === 200 }); } +export function passthrough_write() { + const response = passthroughWrite(); + check(response, { 'passthrough write status equals 200': (r) => r.status === 200 }); +} + export function id_search_module() { const response = executeCmHandleIdSearch('module'); check(response, { 'module ID search status equals 200': (r) => r.status === 200 }); -- cgit 1.2.3-korg