xk6-frostfs/examples/local.js
Alejandro Lopez 7bb16cdd94 [#49] Import and use k6-utils library for uuidv4
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
2023-04-13 16:31:54 +03:00

24 lines
645 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", "")
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)
}
}