From 5243b3748d4091feea14e1db8e84933446d8b377 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Tue, 15 Aug 2017 14:26:55 -0700 Subject: [PATCH] [Example] Limit telemetry responses to 5000 records Update example telemetry providers to limit the number of datums generated so that queries for long time ranges will not cause undesired behavior in demos. --- example/generator/generatorWorker.js | 2 +- example/imagery/plugin.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/example/generator/generatorWorker.js b/example/generator/generatorWorker.js index fd0519f109..5b45363b1d 100644 --- a/example/generator/generatorWorker.js +++ b/example/generator/generatorWorker.js @@ -103,7 +103,7 @@ var data = []; - for (; nextStep < end; nextStep += step) { + for (; nextStep < end && data.length < 5000; nextStep += step) { data.push({ utc: nextStep, yesterday: nextStep - 60*60*24*1000, diff --git a/example/imagery/plugin.js b/example/imagery/plugin.js index 4d48b82bf5..5e30ebfc85 100644 --- a/example/imagery/plugin.js +++ b/example/imagery/plugin.js @@ -79,7 +79,7 @@ define([ var start = options.start; var end = options.end; var data = []; - while (start < end) { + while (start < end && data.length < 5000) { data.push(pointForTimestamp(start)); start += 5000; }