[Endpoint] Log random seed for sample data CLI to console (#60646)
* log random seed to console * fix off by 1 error with children
This commit is contained in:
parent
cd2d54d59a
commit
404e941e63
|
@ -325,7 +325,7 @@ export class EndpointDocGenerator {
|
|||
for (let i = 0; i < generations; i++) {
|
||||
const newParents: EndpointEvent[] = [];
|
||||
parents.forEach(element => {
|
||||
const numChildren = this.randomN(maxChildrenPerNode);
|
||||
const numChildren = this.randomN(maxChildrenPerNode + 1);
|
||||
for (let j = 0; j < numChildren; j++) {
|
||||
timestamp = timestamp + 1000;
|
||||
const child = this.generateEvent({
|
||||
|
|
|
@ -131,8 +131,13 @@ async function main() {
|
|||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
const generator = new EndpointDocGenerator(argv.seed);
|
||||
let seed = argv.seed;
|
||||
if (!seed) {
|
||||
seed = Math.random().toString();
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('No seed supplied, using random seed: ' + seed);
|
||||
}
|
||||
const generator = new EndpointDocGenerator(seed);
|
||||
for (let i = 0; i < argv.numHosts; i++) {
|
||||
await client.index({
|
||||
index: argv.metadataIndex,
|
||||
|
|
Loading…
Reference in a new issue