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>
26 lines
782 B
JavaScript
26 lines
782 B
JavaScript
import local from 'k6/x/frostfs/local';
|
|
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 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';
|
|
const payload = generator.genPayload()
|
|
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)
|
|
}
|
|
}
|