diff --git a/examples/local.js b/examples/local.js index 79161b9..af88ada 100644 --- a/examples/local.js +++ b/examples/local.js @@ -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) diff --git a/examples/native.js b/examples/native.js index 7764fec..38be727 100644 --- a/examples/native.js +++ b/examples/native.js @@ -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() } diff --git a/examples/native_onsite.js b/examples/native_onsite.js index ba71460..e5a556d 100644 --- a/examples/native_onsite.js +++ b/examples/native_onsite.js @@ -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) diff --git a/examples/s3.js b/examples/s3.js index 6e73ec6..8acc5ea 100644 --- a/examples/s3.js +++ b/examples/s3.js @@ -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) } diff --git a/examples/s3local.js b/examples/s3local.js index a88cb55..6b3acee 100644 --- a/examples/s3local.js +++ b/examples/s3local.js @@ -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) }