[#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>
This commit is contained in:
Alexey Vanin 2024-12-28 13:50:30 +03:00
parent a326fbcbf8
commit 3c6023ca29
5 changed files with 15 additions and 6 deletions

View file

@ -1,7 +1,8 @@
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 payload = open('../go.sum', 'b');
const generator = datagen.generator(1024, "random", false);
const local_cli = local.connect("/path/to/config.yaml", "/path/to/config/dir", "", false)
export const options = {
@ -15,6 +16,7 @@ export default function () {
'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)

View file

@ -1,8 +1,9 @@
import native from 'k6/x/frostfs/native';
import datagen from 'k6/x/frostfs/datagen';
import { fail } from "k6";
import { uuidv4 } from '../scenarios/libs/k6-utils-1.4.0.js';
const payload = open('../go.sum', 'b');
const generator = datagen.generator(1024, "random", false);
const frostfs_cli = native.connect("s01.frostfs.devenv:8080", "1dd37fba80fec4e6a6f13fd708d8dcb3b29def768017052f6c930fa1c5d90bbb", 0, 0, false, 0)
export const options = {
@ -27,6 +28,7 @@ export function setup() {
}
export default function (data) {
const payload = generator.genPayload()
let headers = {
'unique_header': uuidv4()
}

View file

@ -1,7 +1,9 @@
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 payload = open('../go.sum', 'b');
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)

View file

@ -1,8 +1,9 @@
import s3 from 'k6/x/frostfs/s3';
import datagen from 'k6/x/frostfs/datagen';
import { fail } from 'k6'
import { uuidv4 } from '../scenarios/libs/k6-utils-1.4.0.js';
const payload = open('../go.sum', 'b');
const generator = datagen.generator(1024, "random", false);
const bucket = "cats"
const s3_cli = s3.connect("https://s3.frostfs.devenv:8080", {'no_verify_ssl': 'true'})
@ -16,7 +17,6 @@ export function setup() {
const params = {
acl: 'private',
lock_enabled: 'true',
location_constraint: 'ru'
}
const res = s3_cli.createBucket(bucket, params)
@ -27,6 +27,7 @@ export function setup() {
export default function () {
const key = uuidv4();
const payload = generator.genPayload()
if (s3_cli.put(bucket, key, payload).success) {
s3_cli.get(bucket, key)
}

View file

@ -1,14 +1,16 @@
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 payload = open('../go.sum', 'b');
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)
}