mirror of
https://github.com/dunglas/frankenphp.git
synced 2025-12-24 13:38:11 +08:00
feat(ext): expose GoValue() and PHPValue() functions (#1877)
* feat(ext): expose a GoValue function * GoValue()
This commit is contained in:
24
testdata/performance/api.js
vendored
24
testdata/performance/api.js
vendored
@@ -1,4 +1,4 @@
|
||||
import http from 'k6/http'
|
||||
import http from "k6/http";
|
||||
|
||||
/**
|
||||
* Many applications communicate with external APIs or microservices.
|
||||
@@ -7,23 +7,25 @@ import http from 'k6/http'
|
||||
*/
|
||||
export const options = {
|
||||
stages: [
|
||||
{ duration: '20s', target: 150 },
|
||||
{ duration: '20s', target: 1000 },
|
||||
{ duration: '10s', target: 0 }
|
||||
{ duration: "20s", target: 150 },
|
||||
{ duration: "20s", target: 1000 },
|
||||
{ duration: "10s", target: 0 },
|
||||
],
|
||||
thresholds: {
|
||||
http_req_failed: ['rate<0.01']
|
||||
}
|
||||
}
|
||||
http_req_failed: ["rate<0.01"],
|
||||
},
|
||||
};
|
||||
|
||||
/* global __ENV */
|
||||
export default function () {
|
||||
// 10-150ms latency
|
||||
const latency = Math.floor(Math.random() * 141) + 10
|
||||
const latency = Math.floor(Math.random() * 141) + 10;
|
||||
// 1-30000 work units
|
||||
const work = Math.ceil(Math.random() * 30000)
|
||||
const work = Math.ceil(Math.random() * 30000);
|
||||
// 1-40 output units
|
||||
const output = Math.ceil(Math.random() * 40)
|
||||
const output = Math.ceil(Math.random() * 40);
|
||||
|
||||
http.get(http.url`${__ENV.CADDY_HOSTNAME}/sleep.php?sleep=${latency}&work=${work}&output=${output}`)
|
||||
http.get(
|
||||
http.url`${__ENV.CADDY_HOSTNAME}/sleep.php?sleep=${latency}&work=${work}&output=${output}`,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user