mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Elastic Infinite test data generation (#70058)
* infinately generate data for elastic * fix counter field
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user