xk6-frostfs/examples/local.js
Anton Nikiforov 26f5262b3d
All checks were successful
Tests and linters / Tests (1.20) (pull_request) Successful in 1m46s
Tests and linters / Tests with -race (pull_request) Successful in 2m9s
DCO action / DCO (pull_request) Successful in 3m26s
Tests and linters / Tests (1.21) (pull_request) Successful in 8m10s
[#90] Support config folder together with config file
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
2023-10-25 16:48:29 +03:00

24 lines
675 B
JavaScript

import local from 'k6/x/frostfs/local';
import { uuidv4 } from '../scenarios/libs/k6-utils-1.4.0.js';
const payload = open('../go.sum', 'b');
const local_cli = local.connect("/path/to/config.yaml", "/path/to/config/dir", "", false)
export const options = {
stages: [
{duration: '30s', target: 10},
],
};
export default function () {
let headers = {
'unique_header': uuidv4()
}
const container_id = '6BVPPXQewRJ6J5EYmAPLczXxNocS7ikyF7amS2esWQnb';
let resp = local_cli.put(container_id, headers, payload)
if (resp.success) {
local_cli.get(container_id, resp.object_id)
} else {
console.log(resp.error)
}
}