private void TryRun(String condition, String tsa, String tsb, bool isInvoked) { EPStatement stmt = _epService.EPAdministrator.CreateEPL("select * from pattern [a=A -> b=B] as abc where " + condition); stmt.Events += _listener.Update; _epService.EPRuntime.SendEvent(SupportTimeStartEndA.Make("E1", tsa, 0)); _epService.EPRuntime.SendEvent(SupportTimeStartEndB.Make("E2", tsb, 0)); Assert.AreEqual(isInvoked, _listener.GetAndClearIsInvoked()); stmt.Dispose(); }
private void TryRun( RegressionEnvironment env, string condition, string tsa, string tsb, bool IsInvoked, AtomicLong milestone) { var epl = "@Name('s0') select * from pattern [a=A -> b=B] as abc where " + condition; env.CompileDeploy(epl).AddListener("s0").MilestoneInc(milestone); env.SendEventBean(SupportTimeStartEndA.Make("E1", tsa, 0), "A"); env.SendEventBean(SupportTimeStartEndB.Make("E2", tsb, 0), "B"); Assert.AreEqual(IsInvoked, env.Listener("s0").GetAndClearIsInvoked()); env.UndeployAll(); }
private void RunAssertion(String epl, String timestampB, long durationB, String expectedAKey) { EPStatement stmt = _epService.EPAdministrator.CreateEPL(epl); stmt.Events += _listener.Update; // query long delta = PerformanceObserver.TimeMillis( delegate { for (int i = 0; i < 1000; i++) { _epService.EPRuntime.SendEvent(SupportTimeStartEndB.Make("B", timestampB, durationB)); Assert.AreEqual(expectedAKey, _listener.AssertOneGetNewAndReset().Get("c0")); } }); Assert.That(delta, Is.LessThan(500)); stmt.Dispose(); }
private void RunAssertion(EPServiceProvider epService, string epl, string timestampB, long durationB, string expectedAKey) { EPStatement stmt = epService.EPAdministrator.CreateEPL(epl); var listener = new SupportUpdateListener(); stmt.Events += listener.Update; // query long startTime = DateTimeHelper.CurrentTimeMillis; for (int i = 0; i < 1000; i++) { epService.EPRuntime.SendEvent(SupportTimeStartEndB.Make("B", timestampB, durationB)); Assert.AreEqual(expectedAKey, listener.AssertOneGetNewAndReset().Get("c0")); } long endTime = DateTimeHelper.CurrentTimeMillis; long delta = endTime - startTime; Assert.IsTrue(delta < 500, "Delta=" + delta / 1000d); stmt.Dispose(); }
private void RunAssertion( RegressionEnvironment env, RegressionPath path, string epl, string timestampB, long durationB, string expectedAKey) { env.CompileDeploy("@Name('s0') " + epl, path).AddListener("s0"); // query var startTime = PerformanceObserver.MilliTime; for (var i = 0; i < 1000; i++) { env.SendEventBean(SupportTimeStartEndB.Make("B", timestampB, durationB)); Assert.AreEqual(expectedAKey, env.Listener("s0").AssertOneGetNewAndReset().Get("c0")); } var endTime = PerformanceObserver.MilliTime; var delta = endTime - startTime; Assert.That(delta, Is.LessThan(500), "Delta=" + delta / 1000d); env.UndeployModuleContaining("s0"); }