public static List <TestDataEvent> CreateNext(TestDataInputConfig config, int runNumber) { List <TestDataEvent> newReferenceData = new List <TestDataEvent>(config.NumberOfItems); for (int i = 0; i < config.NumberOfItems; i++) { newReferenceData.Add(new TestDataEvent() { ItemId = "Item" + i.ToString(), RunNumber = runNumber, EnqueueTimestamp = DateTime.Now, Value = rdm.NextDouble() * 10 }); } return(newReferenceData); }
//Process for Test Data private static void RunTestDataProcess(Application cepApplication) { var config = new TestDataInputConfig() { NumberOfItems = 20, RefreshInterval = TimeSpan.FromMilliseconds(500), TimestampIncrement = TimeSpan.FromMilliseconds(500), AlwaysUseNow = true, EnqueueCtis = false }; AdvanceTimeSettings ats = new AdvanceTimeSettings(new AdvanceTimeGenerationSettings( TimeSpan.FromMilliseconds(750), TimeSpan.FromMilliseconds(200)), null, AdvanceTimePolicy.Drop); var data = RxStream<TestDataEvent>.Create(cepApplication, typeof(TestDataInputFactory), config, EventShape.Point, ats); var sinkConfig = new ConsoleOutputConfig() { ShowCti = true, CtiEventColor = ConsoleColor.Blue, InsertEventColor = ConsoleColor.Green }; var binding = data.ToBinding(cepApplication, typeof(ConsoleOutputFactory), sinkConfig, EventShape.Point); binding.Run("Hello"); }