Add k6 for legacy async batch passthrough read operation
- add kafka support to k6 codebase
- add two new tests: data operation batch passthrough read
and data operation async batch read (from kafka)
- calculate the events/second via Trend
- add kafka ui support to docker-compose
Note: Before this commit being merged, the k6 executable
should have been compiled with the kafka extension of xk6-kafka
Issue-ID: CPS-2268
Change-Id: Ib7777b7bc9f15b210ea36d3541cba0e0c943f883
Signed-off-by: halil.cakal <halil.cakal@est.tech>
diff --git a/k6-tests/ncmp/common/passthrough-crud.js b/k6-tests/ncmp/common/passthrough-crud.js
index 43a215f..76bda4e 100644
--- a/k6-tests/ncmp/common/passthrough-crud.js
+++ b/k6-tests/ncmp/common/passthrough-crud.js
@@ -19,7 +19,12 @@
*/
import http from 'k6/http';
-import { NCMP_BASE_URL, CONTENT_TYPE_JSON_PARAM, getRandomCmHandleId } from './utils.js';
+import {
+ CONTENT_TYPE_JSON_PARAM,
+ getRandomCmHandleId,
+ NCMP_BASE_URL,
+ TOPIC_DATA_OPERATIONS_BATCH_READ
+} from './utils.js';
export function passthroughRead() {
const cmHandleId = getRandomCmHandleId();
@@ -40,3 +45,21 @@
const response = http.post(url, JSON.stringify(body), CONTENT_TYPE_JSON_PARAM);
return response;
}
+
+export function batchRead(cmHandleIds) {
+ const url = `${NCMP_BASE_URL}/ncmp/v1/data?topic=${TOPIC_DATA_OPERATIONS_BATCH_READ}`
+ const payload = {
+ "operations": [
+ {
+ "resourceIdentifier": "parent/child",
+ "targetIds": cmHandleIds,
+ "datastore": "ncmp-datastore:passthrough-operational",
+ "options": "(fields=schemas/schema)",
+ "operationId": "12",
+ "operation": "read"
+ }
+ ]
+ };
+ const response = http.post(url, JSON.stringify(payload), CONTENT_TYPE_JSON_PARAM);
+ return response;
+}
\ No newline at end of file