Elastic Infinite test data generation (#70058)

* infinately generate data for elastic

* fix counter field
pull/70065/head
Gareth Dawson 2 years ago committed by GitHub
parent 87eb76947b
commit 1445a7cc5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      devenv/docker/blocks/elastic/data/data.js

@ -153,6 +153,8 @@ function getRandomLogItem(counter, timestamp) {
};
}
let globalCounter = 0;
async function main() {
await elasticSetupIndexTemplate();
const SLEEP_ANGLE_STEP = Math.PI / 200;
@ -162,10 +164,10 @@ async function main() {
return Math.trunc(1000 * Math.abs(Math.sin(sleepAngle)));
}
for (let step = 0; step < 300; step++) {
while (true) {
await sleep(getNextSineWaveSleepDuration());
const timestamp = new Date();
const item = getRandomLogItem(step + 1, timestamp);
const item = getRandomLogItem(globalCounter++, timestamp);
elasticSendLogItem(timestamp, item);
}
}

Loading…
Cancel
Save