Looking pretty quickly to the rules it looks like:<div><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: medium; "><table class="Bs nH iY" cellpadding="0" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgba(255, 255, 255, 0.917969); width: 1016px; position: relative; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-collapse: collapse; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(228, 228, 228); margin-top: 10px; background-position: initial initial; background-repeat: initial initial; ">
<tbody><tr><td class="Bu" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: arial, sans-serif; vertical-align: top; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">
<div class="nH if" style="padding-top: 0px; padding-right: 0px; padding-bottom: 1px; padding-left: 0px; "><div class="nH"><div class="nH hx" style="color: rgb(34, 34, 34); padding-top: 4px; padding-right: 8px; padding-bottom: 4px; padding-left: 0px; ">
<div class="nH"><div class="h7 ie nH oy8Mbf" style="padding-bottom: 0px; clear: both; "><div class="Bk" style="position: relative; margin-bottom: 10px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(239, 239, 239); border-right-color: rgb(239, 239, 239); border-left-color: rgb(239, 239, 239); border-bottom-color: rgb(226, 226, 226); border-top-width: 0px; border-top-left-radius: 2px 2px; border-top-right-radius: 2px 2px; border-bottom-right-radius: 2px 2px; border-bottom-left-radius: 2px 2px; width: 775px; ">
<div class="G3 G2" style="padding-top: 3px; background-color: rgb(255, 255, 255); border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-right-color: rgb(207, 207, 207); border-bottom-color: rgb(207, 207, 207); border-left-color: rgb(207, 207, 207); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(207, 207, 207); border-top-left-radius: 2px 2px; border-top-right-radius: 2px 2px; border-bottom-right-radius: 2px 2px; border-bottom-left-radius: 2px 2px; ">
<div><div id=":uy"><div class="HprMsc mNrSre"><div class="gs"><div id=":ug" class="ii gt" style="font-size: 13px; margin-top: 5px; margin-right: 15px; margin-bottom: 5px; margin-left: 15px; padding-bottom: 20px; position: relative; z-index: 2; ">
<div id=":uz">$mih:InstanceHealth($id:id, $luid:name, $stat:stat )<br>               from entry-point &quot;stat-stream&quot;</div></div></div></div></div></div></div></div></div></div></div></div></div></td></tr></tbody></table>
</span>Will match for every InstanceHealth without any time restriction, causing that your events will be never evicted . </div><div><br></div><div>Cheers</div><div><br><div class="gmail_quote">On Fri, Sep 23, 2011 at 1:48 PM, cfuser <span dir="ltr">&lt;<a href="mailto:cfuser@yahoo.com">cfuser@yahoo.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I&#39;ll preface this by saying this may not be the correct way to do this, so<br>
suggestions welcome...<br>
<br>
For this example, the name can be something like &#39;collector1&#39;, &#39;collector2&#39;.<br>
For each collector, there are normalized stats, like &#39;CPU&#39;, &#39;IO&#39;, etc.<br>
<br>
&lt;pre&gt;<br>
        // Imports and other stuff<br>
<br>
        declare InstanceHealth<br>
           @role(event)<br>
           @expires(10s)<br>
           @timestamp(timeStamp)<br>
        end<br>
<br>
        rule &quot;Iostats above 90 over 5 seconds&quot;<br>
        when<br>
            $mih:InstanceHealth($id:id, $luid:name, $stat:stat )<br>
                from entry-point &quot;stat-stream&quot;<br>
            $measure : Number( doubleValue &gt; 90 )<br>
                from accumulate(<br>
                    InstanceHealth( $inst:name==$luid, $value:value,<br>
stat==$stat)<br>
                    over window:time( 5s ) from entry-point &quot;stat-stream&quot;,<br>
                    average($value))<br>
        then<br>
            logger.warn( &quot;--------Average--------------&quot; );<br>
            logger.warn( $mih.hashCode() + &quot; // &quot;+$stat +&quot; // &quot;+$id+&quot; :<br>
&quot;+$luid +&quot; == &quot;+$measure );<br>
<br>
            // doStuff based upon the name and stat<br>
        end<br>
<br>
        rule &quot;Log instance&quot;<br>
        when<br>
            $m:InstanceHealth($id:id, $stat:stat, $inst:name, $v:value )<br>
                from entry-point &quot;stat-stream&quot;<br>
        then<br>
            logger.warn( &quot;------------Instance--------------&quot; );<br>
            logger.warn( &quot;--&quot;+$inst+&quot; == &quot;+$stat +&quot; value = &quot;+$v );<br>
<br>
        end<br>
&lt;/pre&gt;<br>
<br>
So the &#39;Iostats above 90 over 5 seconds&#39; rule is trying to match up stats<br>
with collectors so there are no cross-products  (stats aren&#39;t accumulated<br>
across collectors and each stat type gets it&#39;s own evaluation).  This<br>
actually seems to be working, except the InstanceHealth objects don&#39;t seem<br>
to be being evicted and I&#39;m apparently getting multiple activations (?).<br>
Note when I remove the line w/ the $mih binding, things get evicted fine but<br>
I don&#39;t have access to the name, stat, etc.  TIA.<br>
<br>
<br>
A snippet of a log (I can confirm that three different iostats were inserted<br>
for collector2)<br>
<br>
==&gt;[ObjectInsertedEventImpl:<br>
getFactHandle()=1:19:1003982845:1003982845:19:stat-stream,<br>
getObject()=com.poc.mediator.domain.InstanceHealth : null,<br>
getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@30a2268a,<br>
getPropagationContext()=PropagationContextImpl [activeActivations=0,<br>
dormantActivations=15, entryPoint=EntryPoint::stat-stream,<br>
factHandle=1:19:1003982845:1003982845:19:stat-stream, leftTuple=null,<br>
originOffset=-1, propagationNumber=13, rule=null, type=0]]<br>
2011-09-23 11:35:16,004 [Rule-Execution-Thread] WARN  WorkingMemory  -<br>
--------Average--------------<br>
2011-09-23 11:35:16,004 [Rule-Execution-Thread] WARN  WorkingMemory  -<br>
1302111244 // iostats // null : collector2 == 91.0<br>
2011-09-23 11:35:16,004 [Rule-Execution-Thread] WARN  WorkingMemory  -<br>
--------Average--------------<br>
2011-09-23 11:35:16,004 [Rule-Execution-Thread] WARN  WorkingMemory  -<br>
158787804 // iostats // null : collector2 == 91.0<br>
2011-09-23 11:35:16,004 [Rule-Execution-Thread] WARN  WorkingMemory  -<br>
--------Average--------------<br>
2011-09-23 11:35:16,004 [Rule-Execution-Thread] WARN  WorkingMemory  -<br>
1785305512 // iostats // null : collector2 == 91.0<br>
==&gt;[ObjectInsertedEventImpl:<br>
getFactHandle()=1:21:1340153218:1340153218:21:stat-stream,<br>
getObject()=com.poc.mediator.domain.InstanceHealth : null,<br>
getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@30a2268a,<br>
getPropagationContext()=PropagationContextImpl [activeActivations=0,<br>
dormantActivations=20, entryPoint=EntryPoint::stat-stream,<br>
factHandle=1:21:1340153218:1340153218:21:stat-stream, leftTuple=null,<br>
originOffset=-1, propagationNumber=16, rule=null, type=0]]<br>
2011-09-23 11:35:16,100 [Insertion Thread] INFO<br>
mediator.RulesExecutionService  - inserting<br>
com.poc.mediator.domain.InstanceHealth : null...<br>
2011-09-23 11:35:16,101 [Insertion Thread] WARN<br>
mediator.RulesExecutionService  -<br>
&gt;&gt;&gt;&lt;org.drools.event.rule.impl.ObjectInsertedEventImpl@1dddec9e<br>
factHandle=1:21:1340153218:1340153218:21:stat-stream<br>
object=com.poc.mediator.domain.InstanceHealth : null<br>
kruntime=org.drools.impl.StatefulKnowledgeSessionImpl@30a2268a<br>
propagationContext=PropagationContextImpl [activeActivations=0,<br>
dormantActivations=20, entryPoint=EntryPoint::stat-stream,<br>
factHandle=1:21:1340153218:1340153218:21:stat-stream, leftTuple=null,<br>
originOffset=-1, propagationNumber=16, rule=null, type=0]&gt;<br>
2011-09-23 11:35:16,101 [Insertion Thread] INFO<br>
mediator.RulesExecutionService  - ...done inserting<br>
&lt;com.poc.mediator.domain.InstanceHealth@4fe11d82 timeStamp=Fri Sep 23<br>
11:35:16 CDT 2011 stat=cpu value=88.0 id=null version=null<br>
Instance=com.poc.mediator.domain.Instance : null&gt;<br>
2011-09-23 11:35:16,108 [Insertion Thread] INFO<br>
mediator.RulesExecutionService  - inserting<br>
com.poc.mediator.domain.InstanceHealth : null...<br>
2011-09-23 11:35:16,109 [Insertion Thread] WARN<br>
mediator.RulesExecutionService  -<br>
&gt;&gt;&gt;&lt;org.drools.event.rule.impl.ObjectInsertedEventImpl@56300388<br>
factHandle=1:23:1092542236:1092542236:23:stat-stream<br>
object=com.poc.mediator.domain.InstanceHealth : null<br>
kruntime=org.drools.impl.StatefulKnowledgeSessionImpl@30a2268a<br>
propagationContext=PropagationContextImpl [activeActivations=2,<br>
dormantActivations=19, entryPoint=EntryPoint::stat-stream,<br>
factHandle=1:23:1092542236:1092542236:23:stat-stream, leftTuple=null,<br>
originOffset=-1, propagationNumber=17, rule=null, type=0]&gt;<br>
2011-09-23 11:35:16,109 [Insertion Thread] INFO<br>
mediator.RulesExecutionService  - ...done inserting<br>
&lt;com.poc.mediator.domain.InstanceHealth@411edf1c timeStamp=Fri Sep 23<br>
11:35:16 CDT 2011 stat=iostats value=85.0 id=null version=null<br>
Instance=com.poc.mediator.domain.Instance : null&gt;<br>
==&gt;[ObjectInsertedEventImpl:<br>
getFactHandle()=1:23:1092542236:1092542236:23:stat-stream,<br>
getObject()=com.poc.mediator.domain.InstanceHealth : null,<br>
getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@30a2268a,<br>
getPropagationContext()=PropagationContextImpl [activeActivations=2,<br>
dormantActivations=19, entryPoint=EntryPoint::stat-stream,<br>
factHandle=1:23:1092542236:1092542236:23:stat-stream, leftTuple=null,<br>
originOffset=-1, propagationNumber=17, rule=null, type=0]]<br>
2011-09-23 11:35:16,160 [Rule-Execution-Thread] WARN  WorkingMemory  -<br>
------------Instance--------------<br>
2011-09-23 11:35:16,161 [Rule-Execution-Thread] WARN  WorkingMemory  -<br>
--collector1 == iostats value = 85.0<br>
2011-09-23 11:35:16,161 [Rule-Execution-Thread] WARN  WorkingMemory  -<br>
------------Instance--------------<br>
2011-09-23 11:35:16,161 [Rule-Execution-Thread] WARN  WorkingMemory  -<br>
--collector2 == cpu value = 88.0<br>
2011-09-23 11:35:17,013 [Rule-Execution-Thread] WARN  WorkingMemory  -<br>
--------Average--------------<br>
2011-09-23 11:35:17,014 [Rule-Execution-Thread] WARN  WorkingMemory  -<br>
1302111244 // iostats // null : collector2 == 92.0<br>
2011-09-23 11:35:17,014 [Rule-Execution-Thread] WARN  WorkingMemory  -<br>
--------Average--------------<br>
2011-09-23 11:35:17,014 [Rule-Execution-Thread] WARN  WorkingMemory  -<br>
158787804 // iostats // null : collector2 == 92.0<br>
2011-09-23 11:35:17,014 [Rule-Execution-Thread] WARN  WorkingMemory  -<br>
--------Average--------------<br>
2011-09-23 11:35:17,014 [Rule-Execution-Thread] WARN  WorkingMemory  -<br>
1785305512 // iostats // null : collector2 == 92.0<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Expiry-of-events-not-occurring-for-sliding-window-tp3362402p3362402.html" target="_blank">http://drools.46999.n3.nabble.com/Expiry-of-events-not-occurring-for-sliding-window-tp3362402p3362402.html</a><br>

Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br><br clear="all"><div><br></div>-- <br> - CTO @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com</a>  <br> - MyJourney @ <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a><div>
- Co-Founder @ <a href="http://www.jugargentina.org" target="_blank">http://www.jugargentina.org</a><br> - Co-Founder @ <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br> <br> - Salatino &quot;Salaboy&quot; Mauricio -</div>
<br>
</div>