xk6-frostfs/scenarios/libs/keygen.js

17 lines
458 B
JavaScript
Raw Normal View History

import {uuidv4} from './k6-utils-1.4.0.js';
export function generateS3Key() {
let width = parseInt(__ENV.DIR_WIDTH || '0');
let height = parseInt(__ENV.DIR_HEIGHT || '0');
let key = ''
if (width > 0 && height > 0) {
for (let index = 0; index < height; index++) {
const w = Math.floor(Math.random() * width) + 1;
key = key + 'dir' + w + '/';
}
}
key += (__ENV.OBJ_NAME || uuidv4());
return key;
}