xk6-frostfs/examples/native_onsite.js
Evgenii Stratonikov e52a315752 [#50] Use native.connect timeouts everywhere
Also, use defaults from the SDK itself, allow user to provide 0.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-02-03 17:12:26 +03:00

25 lines
696 B
JavaScript

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