public void TestOp() { Configuration config = SupportConfigFactory.GetConfiguration(); config.EngineDefaults.ThreadingConfig.IsInternalTimerEnabled = false; config.EngineDefaults.ExpressionConfig.IsUdfCache = false; config.EngineDefaults.ThreadingConfig.IsThreadPoolOutbound = true; config.EngineDefaults.ThreadingConfig.ThreadPoolOutboundNumThreads = 5; config.AddEventType <SupportBean>(); EPServiceProvider epService = EPServiceProviderManager.GetDefaultProvider(config); epService.Initialize(); var listener = new SupportListenerSleeping(200); EPStatement stmt = epService.EPAdministrator.CreateEPL("select * from SupportBean"); stmt.Events += listener.Update; long delta = PerformanceObserver.TimeMillis( delegate { for (int i = 0; i < 5; i++) { epService.EPRuntime.SendEvent(new SupportBean()); } }); Assert.IsTrue(delta < 100, "Delta is " + delta); Thread.Sleep(1000); Assert.AreEqual(5, listener.NewEvents.Count); epService.Dispose(); }
public override void Run(EPServiceProvider epService) { var listener = new SupportListenerSleeping(200); EPStatement stmt = epService.EPAdministrator.CreateEPL("select * from SupportBean"); stmt.Events += listener.Update; long start = PerformanceObserver.NanoTime; for (int i = 0; i < 5; i++) { epService.EPRuntime.SendEvent(new SupportBean()); } long end = PerformanceObserver.NanoTime; long delta = (end - start) / 1000000; Assert.IsTrue(delta < 100, "Delta is " + delta); Thread.Sleep(1000); Assert.AreEqual(5, listener.NewEvents.Count); }