<div dir="ltr"><p class="MsoNormal"><span lang="EN-US">Dear Drools
Experts,</span></p><p class="MsoNormal"><span lang="EN-US"><br></span></p>

<p class="MsoNormal"><b><span lang="EN-US">Short version</span></b></p>

<p class="" style></p><ol><li><span lang="EN-US" style>Cron-based rules triggers (more than
once) for a full second, rather than once every defined period;</span><br></li><li><span lang="EN-US" style>After some time, event creation from the drl seems to hang. The &ldquo;time to hang&rdquo; decreases as we
increase the throughput of incoming events;</span><br></li><li><span lang="EN-US" style>The two issues seem to be somehow
related (well, maybe).</span><br></li></ol><p></p>





<p class="MsoNormal"><b><span lang="EN-US">Full version</span></b></p><p class="MsoNormal"><b><span lang="EN-US"><br></span></b></p>

<p class="MsoNormal"><span lang="EN-US">We are testing
Drools Fusion to implement CEP functionalities in our platform. We are
performing these tests using Drools 6.0.1.Final. </span></p>

<p class="MsoNormal"><span lang="EN-US">As a basic
test case, we set up a synthetic stream of events, and defined a couple of
rules to implement a simple throughput metric. Here&rsquo;s the complete drl:</span></p><p class="MsoNormal"><span lang="EN-US"><br></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">package</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> it.intext.unity.test</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;">&nbsp;</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">import</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> it.intext.unity.test.SynthEvent;</span><span style="font-family:&#39;Courier New&#39;;font-size:10pt">&nbsp;</span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">import</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> java.util.Date;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;">&nbsp;</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">global</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> org.slf4j.Logger logger;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;">&nbsp;</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">declare</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> SynthEvent</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp; @role( event )</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp; @timestamp( timestamp )</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">end</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;">&nbsp;</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">declare</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> EventCounter</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @role( event )</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @timestamp( timestamp )</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">long</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; key&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : String</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; timestamp &nbsp; : Date</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">end</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;">&nbsp;</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;">&nbsp;</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:olive">// Business rules</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">rule</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;Create
counter&quot;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt;text-indent:35.4pt"><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">when</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 70.8pt;text-indent:35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">$e : SynthEvent() </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">from</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> entry-point </span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;synth&quot;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt;text-indent:35.4pt"><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">then</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 106.2pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">entryPoints[</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;counters&quot;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">].</span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">insert</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">(</span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">new</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> EventCounter( $e.getId(), </span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;event&quot;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">, $e.getTimestamp() ) );</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">end</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:olive">// Metrics</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">rule</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;Count
epm&quot;</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:olive">// Emit count every 10s, accumulate over 1m</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt;text-indent:35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">timer ( cron: 0/10 * * * * ? )</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">when</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Number( $count : intValue ) </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">from</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">accumulate</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">(</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EventCounter( key
== </span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;event&quot;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> ) over window:time( 60s )</span><b style="text-indent:35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">from</span></b><span lang="EN-US" style="text-indent:35.4pt;font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> entry-point </span><span lang="EN-US" style="text-indent:35.4pt;font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;counters&quot;</span><span lang="EN-US" style="text-indent:35.4pt;font-size:10pt;font-family:&#39;Courier New&#39;;color:black">,&nbsp;</span><span style="color:black;font-family:&#39;Courier New&#39;;font-size:10pt;text-indent:35.4pt">count(1) )</span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">then</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 70.8pt;text-indent:35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">logger.debug(</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;epm = {}&quot;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">, $count );</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-left:35.4pt"><b><span style="font-size:10pt;line-height:115%;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">end</span></b></p>

<p class="MsoNormal"><span lang="EN-US"><br></span></p><p class="MsoNormal"><span lang="EN-US">The
SynthEvent class is very basic:</span></p><p class="MsoNormal"><span lang="EN-US"><br></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">public</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">class</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> SynthEvent {</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;">&nbsp;</span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">long</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(0,0,192)">id</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">Date </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(0,0,192)">timestamp</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">;</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10pt;line-height:115%;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; List&lt;String&gt; </span><span style="font-size:10pt;line-height:115%;font-family:&#39;Courier New&#39;;color:rgb(0,0,192)">meta</span><span style="font-size:10pt;line-height:115%;font-family:&#39;Courier New&#39;;color:black">;</span></p>


<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10pt;line-height:115%;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &hellip; // Getters/Setters and constructors omitted</span></p>

<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10pt;line-height:115%;font-family:&#39;Courier New&#39;;color:black">}</span></p>

<p class="MsoNormal"><span lang="EN-US"><br></span></p><p class="MsoNormal"><span lang="EN-US">Now, the
test is performed running the session in one thread (code below)</span></p><p class="MsoNormal"><span lang="EN-US"><br></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">private</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">void</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> process(</span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">final</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">
KieSession session) {</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">new</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> Thread(){</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">public</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">void</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> run() {</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">session.fireUntilHalt();</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }.start();</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>

<p class="MsoNormal"><span lang="EN-US">while feeding
the events on a second thread (code below)</span></p><p class="MsoNormal"><span lang="EN-US"><br></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">private</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">void</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> feed(</span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">final</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">
KieSession session) {</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">new</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> Thread(){</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(100,100,100)">@SuppressWarnings</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">(</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(42,0,255)">&quot;unchecked&quot;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">)</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">public</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">void</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> run() {</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">try</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> {</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">int</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> counter = 0;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">while</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">(</span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">true</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">) { </span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; counter++;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session.execute(CommandFactory.<i>newInsert</i>(createEvent(),
</span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">null</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">, </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">false</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">, </span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(42,0,255)">&quot;synth&quot;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">));</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thread.<i>sleep</i>(getSleepRate());</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">if</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> ((counter %
1000) == 0) {</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><i><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(0,0,192)">logger</span></i><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">.debug(</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(42,0,255)">&quot;Total events: {}&quot;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">, counter);</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(127,0,85)">catch</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">
(InterruptedException e) {</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><i><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(0,0,192)">logger</span></i><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">.warn(</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(42,0,255)">&quot;{}&quot;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">, e);</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }.start();</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal"><span lang="EN-US" style="font-size:10pt;line-height:115%;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><span lang="EN-US"></span></p>

<p class="MsoNormal"><span lang="EN-US">I expected
the cron rule &ldquo;count epm&rdquo; to trigger once every 10 seconds. But here&rsquo;s an
extract from the log (running at 5 events per second +/- 20%):</span></p>

<p class="">[DEBUG]
2014-03-25 04:56:10.008 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 1<br>[DEBUG]
2014-03-25 04:56:10.075 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 2<br>[DEBUG]
2014-03-25 04:56:10.262 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 3<br>[DEBUG]
2014-03-25 04:56:10.507 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 4<br>[DEBUG]
2014-03-25 04:56:10.678 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 5<br>[DEBUG]
2014-03-25 04:56:10.871 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 6<br>[DEBUG]
2014-03-25 04:56:20.001 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 50<br>[DEBUG]
2014-03-25 04:56:20.042 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 51<br>[DEBUG]
2014-03-25 04:56:20.231 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 52<br>[DEBUG]
2014-03-25 04:56:20.405 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 53<br>[DEBUG]
2014-03-25 04:56:20.647 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 54<br>[DEBUG]
2014-03-25 04:56:20.823 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 55<br>[DEBUG]
2014-03-25 04:56:20.992 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 56<br></p>

























<p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>

<p class="MsoNormal"><span lang="EN-US">As you can
see, the &ldquo;count epm&rdquo; rules fires once per incoming event for a full second (e.g.
for the second cycle we see the first activation at 04:56:20.001 and the last
one at 04:56:20.992).&nbsp;</span></p><p class="MsoNormal"><span lang="EN-US">This is not a major issue, since it can be solved with a
sort-of publish/subscribe pattern which, BTW, increases the system stability (if anyone is interested I can post more details
on the list).&nbsp;</span></p><p class="MsoNormal"><span lang="EN-US">Anyhow, the test ran for more than 20&rsquo; consistently until we
decided it was enough.</span></p><p class="MsoNormal"><span lang="EN-US"><br></span></p>

<p class="MsoNormal"><span lang="EN-US">Now, the problem
is that as we increase the throughput (e.g. 50 events per second), the test
runs for a few minutes before it becomes inconsistent. The evidence is that the
first rule stops to trigger, and EventCounter aren&rsquo;t created anymore. Here&rsquo;s a log
extract:</span></p>

<p class="">[DEBUG]
2014-03-25 07:37:40.008 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 199<br>[DEBUG]
2014-03-25 07:37:40.017 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 200<br>[DEBUG]
2014-03-25 07:37:40.034 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 201<br>[DEBUG]
2014-03-25 07:37:40.058 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 202<br>[DEBUG]
2014-03-25 07:37:40.076 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 203<br><i><span lang="EN-US">&hellip; here the system is stable as we get about 3K
events per minute as expected</span></i><br>[DEBUG]
2014-03-25 07:38:36.022 (StreamTester.java:run:70) Total events: 3000<br>[DEBUG]
2014-03-25 07:38:40.001 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 2999<br>[DEBUG]
2014-03-25 07:38:40.016 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 2998<br>[DEBUG]
2014-03-25 07:38:40.024 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 2999<br>[DEBUG]
2014-03-25 07:38:40.034 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 2998<br>[DEBUG]
2014-03-25 07:38:40.047 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 2999<br>[DEBUG]
2014-03-25 07:38:40.057 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 2998<br>&hellip;<br>[DEBUG]
2014-03-25 07:39:50.974 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 3008<br>[DEBUG]
2014-03-25 07:39:50.988 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 3007<br>[DEBUG]
2014-03-25 07:39:50.996 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 3008<br>[DEBUG]
2014-03-25 07:39:55.842 (StreamTester.java:run:70) Total events: 7000<br><i><span lang="EN-US">&hellip; Somewhere in between the system becomes
inconsistent and the number of events decreases to 0</span></i><br>&nbsp;[DEBUG] 2014-03-25 07:40:00.001
(Rule_Count_epm442808096.java:defaultConsequence:14) epm = 2734<br>&nbsp;[DEBUG] 2014-03-25 07:40:00.017
(Rule_Count_epm442808096.java:defaultConsequence:14) epm = 2733<br>&nbsp;[DEBUG] 2014-03-25 07:40:00.037
(Rule_Count_epm442808096.java:defaultConsequence:14) epm = 2732<br>&hellip;<br>[DEBUG] 2014-03-25 07:40:50.937
(Rule_Count_epm442808096.java:defaultConsequence:14) epm = 181<br>[DEBUG]
2014-03-25 07:40:50.953 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 180<br>[DEBUG]
2014-03-25 07:40:50.975 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 179<br>[DEBUG]
2014-03-25 07:40:50.997 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 178<br>[DEBUG]
2014-03-25 07:40:55.438 (StreamTester.java:run:70) Total events: 10000<br>&nbsp;[DEBUG] 2014-03-25 07:41:00.001
(Rule_Count_epm442808096.java:defaultConsequence:14) epm = 0<br>[DEBUG]
2014-03-25 07:41:10.001 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 0<br>&nbsp;<br>We added a
quick rule to count &ldquo;live EventCounter&rdquo;<br></p>





























































<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">rule</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;Count live
counters&quot;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>

<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp; timer ( cron: 0/60 * * * * ? )</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">when</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Number( $count :
intValue ) </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">from</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">accumulate</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">(</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EventCounter( key
== </span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;event&quot;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> ) </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">from</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> entry-point </span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;counters&quot;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">, count(1) )</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">then</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; logger.debug(</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;Live counters = {}&quot;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">, $count );</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 35.4pt"><b><span style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">end</span></b><span style="font-size:10pt;font-family:&#39;Courier New&#39;"></span></p>


<p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>

<p class="MsoNormal"><span lang="EN-US">and, again,
the evidence is that when things go wrong the EventCounter events aren&rsquo;t
created anymore.</span></p>

<p class="">[DEBUG]
2014-03-25 07:40:55.438 (StreamTester.java:run:70) Total events: 10000<br>[DEBUG]
2014-03-25 07:41:00.001 (Rule_Count_live_counters1625367465.java:defaultConsequence:14)
Live counters = 0<br>[DEBUG]
2014-03-25 07:41:00.001 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 0<br>[DEBUG]
2014-03-25 07:41:10.001 (Rule_Count_epm442808096.java:defaultConsequence:14)
epm = 0</p>

<p class="MsoNormal"><span lang="EN-US">Adding a debug line in the &quot;Create counter&quot; rule confirm this hypotesis (after a while the rule won&#39;t trigger anymore). Modified rule is:</span></p><p class="MsoNormal">
<span lang="EN-US"><br></span></p><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><p class="MsoNormal" style="margin-bottom:0.0001pt"><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">rule</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> </span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;Create counter&quot;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">when</span></b></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp; &nbsp; $e : SynthEvent() </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">from</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> entry-point </span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;synth&quot;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp; </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">then</span></b></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp; &nbsp; entryPoints[</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;counters&quot;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">].</span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">insert</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">( </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">new</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> EventCounter( $e.getId(), </span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;event&quot;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">,
$e.getTimestamp() ) );</span></p><p class="MsoNormal" style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">&nbsp;&nbsp;&nbsp; &nbsp; </span><b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">if</span></b><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black"> (Math.random() &lt; 0.01) logger.debug(</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:green">&quot;New event: {}&quot;</span><span lang="EN-US" style="font-size:10pt;font-family:&#39;Courier New&#39;;color:black">, $e.getId());</span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;line-height:115%;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)">end</span></b></p></blockquote><p class="MsoNormal">











</p><p class="MsoNormal"><b><span style="font-size:10pt;line-height:115%;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)"><br></span></b></p>When the system becomes inconsistent, we stop seeing &quot;New event&quot; log lines.<p class="MsoNormal">
<b><span style="font-size:10pt;line-height:115%;font-family:&#39;Courier New&#39;;color:rgb(150,0,0)"><br></span></b></p><p class="MsoNormal"><span lang="EN-US">What are we
missing? Any suggestion? Anyone experienced the same problems we have?</span></p><p class="MsoNormal"><span lang="EN-US">Your help will be greatly appreciated.</span></p>

<p class="MsoNormal"><span lang="EN-US">Thanks in
advance,</span></p>

<p class="MsoNormal"><span lang="EN-US">Vieri</span></p><div><br></div></div>