xk6-frostfs/examples/s3local.js
Alex Vanin 3c6023ca29 [#114] Fix examples
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>
2024-12-28 13:57:54 +03:00

17 lines
612 B
JavaScript

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)
}
}