Add documentation.

This commit is contained in:
Florian THIERRY
2025-10-09 17:54:36 +02:00
parent 13d811faae
commit 5c6d54c459
8 changed files with 123 additions and 11 deletions
-3
View File
@@ -1,3 +0,0 @@
target:
url: http://localhost
port: 51001
+1 -4
View File
@@ -6,10 +6,7 @@
"type": "module",
"scripts": {
"build": "vite build",
"test:demo": "yarn build && k6 run dist/tests/load-tests.cjs",
"test:demo-stages": "yarn build && k6 run dist/tests/reqres-stages.cjs",
"test-with-monitoring:demo": "yarn build && docker run --platform linux/amd64 -it -p 5665:5665 -v $(pwd)/dist/:/src ghcr.io/grafana/xk6-dashboard:0.6.1 run --out 'dashboard=period=2s' /src/tests/reqres.cjs",
"test-with-monitoring:demo-stages": "yarn build && docker run --platform linux/amd64 -it -p 5665:5665 -v $(pwd)/dist/:/src ghcr.io/grafana/xk6-dashboard:0.6.1 run --out 'dashboard=period=2s' /src/tests/reqres-stages.cjs"
"start": "yarn build && k6 run dist/tests/load-tests.cjs"
},
"devDependencies": {
"@babel/core": "7.23.3",
+2 -3
View File
@@ -4,6 +4,7 @@ import {logWaitingTime} from "../utils/logger";
import {Trend} from "k6/metrics";
import {check} from "k6";
import {Response} from "../data/common";
import {TARGET_URL} from "../tests/config";
// Metrics that we want to track
const metrics = {
@@ -11,9 +12,7 @@ const metrics = {
};
export const getMarketplace = (): Response<Marketplace> => {
const serverUrl = `http://localhost:51001`;
const urlToTest = `${serverUrl}/api/marketplace`;
const urlToTest = `${TARGET_URL}/api/marketplace`;
const response = http.get(urlToTest);
logWaitingTime({
+6 -1
View File
@@ -1 +1,6 @@
export const VUs = 1
export const VUs = 1;
// @ts-ignore - if it is unused
const VIRTUAL_THREADS_APP_PORT = 51001;
// @ts-ignore - if it is unused
const REACTOR_APP_PORT = 52001;
export const TARGET_URL = `http://localhost:${VIRTUAL_THREADS_APP_PORT}`;