xk6-frostfs/examples/s3local.js

18 lines
612 B
JavaScript
Raw Normal View History

import s3local from 'k6/x/frostfs/s3local';
import datagen from 'k6/x/frostfs/datagen';
import { uuidv4 } from '../scenarios/libs/k6-utils-1.4.0.js';
const bucket = "testbucket"
const generator = datagen.generator(1024, "random", false);
const s3local_cli = s3local.connect("path/to/storage/config.yml", "path/to/storage/config/dir", {}, {
'testbucket': 'GBQDDUM1hdodXmiRHV57EUkFWJzuntsG8BG15wFSwam6',
});
export default function () {
const key = uuidv4();
const payload = generator.genPayload()
if (s3local_cli.put(bucket, key, payload).success) {
s3local_cli.get(bucket, key)
}
}