forked from TrueCloudLab/xk6-frostfs
Alex Vanin
3c6023ca29
With #114, upload data functions now works with datagen payload only, thus examples has to be updated. Signed-off-by: Alex Vanin <a.vanin@yadro.com>
27 lines
803 B
JavaScript
27 lines
803 B
JavaScript
import native from 'k6/x/frostfs/native';
|
|
import datagen from 'k6/x/frostfs/datagen';
|
|
import { uuidv4 } from '../scenarios/libs/k6-utils-1.4.0.js';
|
|
|
|
const generator = datagen.generator(1024, "random", false);
|
|
const payload = generator.genPayload()
|
|
const container = "AjSxSNNXbJUDPqqKYm1VbFVDGCakbpUNH8aGjPmGAH3B"
|
|
const frostfs_cli = native.connect("s01.frostfs.devenv:8080", "", 0, 0, false, 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)
|
|
}
|
|
}
|