Skip to content

Instantly share code, notes, and snippets.

@hexfusion
Created January 21, 2023 19:43
Show Gist options
  • Save hexfusion/5741024a62a4fa800deb0f377a2a3ece to your computer and use it in GitHub Desktop.
Save hexfusion/5741024a62a4fa800deb0f377a2a3ece to your computer and use it in GitHub Desktop.
import exec from 'k6/execution';
export const options = {
scenarios: {
constant_request_rate: {
executor: 'constant-arrival-rate',
rate: 1000,
timeUnit: '1s', // 1000 iterations per second
duration: '120s',
preAllocatedVUs: 1500, // how large the initial pool of VUs would be
maxVUs: 1500,
},
},
};
export default function () {
const url = 'http://127.0.0.1:9658/ext/bc/mvz4Tr8ZGiS8eHVf4cuCFMkiCnx9ahGESTtxirjojFLcMHizF/rpc';
const payload = `{"jsonrpc":"2.0","method":"timestampvm.proposeBlock","params":[{"data":"MQo="}],"id": ${exec.scenario.iterationInTest}}`
const params = {
headers: {
'Content-Type': 'application/json',
},
};
const res = http.post(url, payload, params);
check(res, {
'is status 200': (r) => r.status === 200,
});
}
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment