xk6-frostfs/examples/native.js
Alex Vanin 1c0abb2479 [#5] Avoid payload copy in put methods
With goja.ArrayBuffer type VU won't perform
copy operation during every put invocation.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2022-05-20 14:33:56 +03:00

24 lines
641 B
JavaScript

import { uuidv4 } from 'https://jslib.k6.io/k6-utils/1.2.0/index.js';
import native from 'k6/x/neofs/native';
const payload = open('../go.sum', 'b');
const container = "AjSxSNNXbJUDPqqKYm1VbFVDGCakbpUNH8aGjPmGAH3B"
const neofs_cli = native.connect("s01.neofs.devenv:8080", "")
export const options = {
stages: [
{ duration: '30s', target: 10 },
],
};
export default function () {
let headers = {
'unique_header': uuidv4()
}
let resp = neofs_cli.put(container, headers, payload)
if (resp.success) {
neofs_cli.get(container, resp.object_id)
} else {
console.log(resp.error)
}
}