/**
 * 
 */
package alokawi.poc.videoview;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;

/**
 * @author alokkumar
 *
 */
public class VideoViewEventDataGenerator {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		int numberOfRecords = 10000;

		VideoViewEventDataGenerator eventDataGenerator = new VideoViewEventDataGenerator();
		eventDataGenerator.generate(numberOfRecords);

	}

	private void generate(int numberOfRecords) {

		Date date = new Date(1485907200000L);

		List<VideoViewEvent> videoViewEvents = new ArrayList<>();
		for (int i = 0; i < numberOfRecords; i++) {
			VideoViewEvent videoViewEvent = new VideoViewEvent();

			videoViewEvent.setUserId("u-" + UUID.randomUUID().toString());
			videoViewEvent.setVideoId("v-" + UUID.randomUUID().toString());
			videoViewEvent.setSessionId("s-" + UUID.randomUUID().toString());

			// Randomly increase and set time
			videoViewEvent.setEventStartTimestamp(date.getTime() + ((i + 1) * (i + 1) * (i + 1)));

			// Get duration in seconds from 5 to 45 seconds
			videoViewEvent.setViewDurationInSeconds(5 * (i % 9) + 5);

			System.out.println(i + " : " + videoViewEvent);
			videoViewEvents.add(videoViewEvent);
		}
	}

}

@@ -82,20 +82,20 @@
 va.util.
-Date
+List
 ;%0Aimport
@@ -97,36 +97,38 @@
 mport java.util.
-List
+Random
 ;%0Aimport java.ut
@@ -135,16 +135,63 @@
 il.UUID;
+%0Aimport java.util.concurrent.ThreadLocalRandom;
 %0A%0A/**%0A *
@@ -329,16 +329,73 @@
 rgs) %7B%0A%0A
+%09%09int numberOfUsers = 1000;%0A%09%09int numberOfVideos = 100;%0A%0A
 %09%09int nu
@@ -419,234 +419,604 @@
 0000
+0
 ;%0A%0A%09%09
-VideoViewEventDataGenerator eventDataGenerator = new VideoViewEventDataGenerator();%0A%09%09eventDataGenerator.generate(numberOfRecords);%0A%0A%09%7D%0A%0A%09private void generate(int numberOfRecords) %7B%0A%0A%09%09Date date = new Date(1485907200000L
+// timeRange = 1Feb to 15Feb%0A%09%09long timeOrigin = 1485907200000L;%0A%09%09long timeEnd = 1487226374000L;%0A%0A%09%09// interval k = 5 here%0A%09%09int viewDurationInterval = 5;%0A%0A%09%09VideoViewEventDataGenerator eventDataGenerator = new VideoViewEventDataGenerator();%0A%09%09eventDataGenerator.generate(numberOfUsers, numberOfVideos, numberOfRecords, timeOrigin, timeEnd,%0A%09%09%09%09viewDurationInterval);%0A%0A%09%7D%0A%0A%09private void generate(int numberOfUsers, int numberOfVideos, int numberOfRecords, long timeOrigin, long timeEnd,%0A%09%09%09int viewDurationInterval) %7B%0A%0A%09%09Random randomUser = new Random();%0A%09%09Random randomVideo = new Random(
 );%0A%0A
@@ -1218,35 +1218,40 @@
 %22 + 
-UUID.
 randomU
-UID().toString(
+ser.nextInt(numberOfUsers
 ));%0A
@@ -1290,35 +1290,42 @@
 %22 + 
-UUID.
 random
-UUID().toString(
+Video.nextInt(numberOfVideos
 ));%0A
@@ -1413,29 +1413,44 @@
 mly 
-increase and set time
+get time from 1Feb to 15Feb duration
 %0A%09%09%09
@@ -1491,53 +1491,64 @@
 amp(
-date.getTime() + ((i + 1) * (i + 1) * (i + 1)
+ThreadLocalRandom.current().nextLong(timeOrigin, timeEnd
 ));%0A
@@ -1646,23 +1646,72 @@
 nds(
-5 * (i %25 9) + 5
+viewDurationInterval * ThreadLocalRandom.current().nextInt(1, 9)
 );%0A%0A

Update data generator to accept time-range, interval & other input as parameters