add a simple k6 script for loadtesting/benchig (#69)

Signed-off-by: Jun Woo Shin <jwoos@fb.com>
This commit is contained in:
Jun Woo Shin
2022-09-13 16:35:18 -04:00
committed by GitHub
parent 319d23f078
commit a12656dd32

24
scripts/k6/simple.js Normal file
View File

@@ -0,0 +1,24 @@
import http from 'k6/http';
import { sleep } from 'k6';
const BASE_URL = 'http://localhost:16789/api/v1';
export default function () {
const endpoints = [
'algorithms',
'provider',
'system',
'getToplogy',
'currentModel',
];
const requests = endpoints.map(endpoint => {
return {
method: 'GET',
url: `${BASE_URL}/${endpoint}`,
};
});
let responses = http.batch(requests);
sleep(0.1);
}