[rules-users] How to improve drools performance?
Is there a way to log / monitor the time taken for rule in a Drools rule set? Is there a way to make sure that one rule is not executed more than once(It seems to be happening in my case) What are the general guidelines on improving Drools performance? Currently I am using a one single DRL file with 100 odd rules. Any additiional information you need will be provided. Thanks, Abdul -- View this message in context: http://drools.46999.n3.nabble.com/How-to-improve-drools-performance-tp3416326p3416326.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] How to improve drools performance?
You could create a listener and combine it with a log. There is org.drools.event.rule.DefaultAgendaEventListener that has two methods I use to log which rule started firing and when the rule completes firing with: @Override public void beforeActivationFired(BeforeActivationFiredEvent event) { try { logFile.write(Package( + event.getActivation().getRule().getPackageName() + ).Rule( + event.getActivation().getRule().getName() + ) firing ... ); } catch (Exception e) { } } @Override public void afterActivationFired(AfterActivationFiredEvent event) { try { logFile.write(done!\n); } catch (Exception e) { } } You could obviously do other logging with time and date stamps, or send it to a database rather than a .log file like I'm doing here. In my case I get a list of all rules that fire in a fireallrules session. I can see if a rule fires multiple times, or ends up in an endless loop. Peace! Dean -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of arrehman Sent: Wednesday, October 12, 2011 1:21 PM To: rules-users@lists.jboss.org Subject: [rules-users] How to improve drools performance? Is there a way to log / monitor the time taken for rule in a Drools rule set? Is there a way to make sure that one rule is not executed more than once(It seems to be happening in my case) What are the general guidelines on improving Drools performance? Currently I am using a one single DRL file with 100 odd rules. Any additiional information you need will be provided. Thanks, Abdul -- View this message in context: http://drools.46999.n3.nabble.com/How-to-improve-drools-performance-tp3416326p3416326.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] How to improve drools performance?
That works. Just FYI, the same data is available through the Drools MBeans... you can use jconsole to monitor it or any other JMX console. Edson 2011/10/12 Dean Whisnant d...@basys.com You could create a listener and combine it with a log. There is org.drools.event.rule.DefaultAgendaEventListener that has two methods I use to log which rule started firing and when the rule completes firing with: @Override public void beforeActivationFired(BeforeActivationFiredEvent event) { try { logFile.write(Package( + event.getActivation().getRule().getPackageName() + ).Rule( + event.getActivation().getRule().getName() + ) firing ... ); } catch (Exception e) { } } @Override public void afterActivationFired(AfterActivationFiredEvent event) { try { logFile.write(done!\n); } catch (Exception e) { } } You could obviously do other logging with time and date stamps, or send it to a database rather than a .log file like I'm doing here. In my case I get a list of all rules that fire in a fireallrules session. I can see if a rule fires multiple times, or ends up in an endless loop. Peace! Dean -Original Message- From: rules-users-boun...@lists.jboss.org [mailto: rules-users-boun...@lists.jboss.org] On Behalf Of arrehman Sent: Wednesday, October 12, 2011 1:21 PM To: rules-users@lists.jboss.org Subject: [rules-users] How to improve drools performance? Is there a way to log / monitor the time taken for rule in a Drools rule set? Is there a way to make sure that one rule is not executed more than once(It seems to be happening in my case) What are the general guidelines on improving Drools performance? Currently I am using a one single DRL file with 100 odd rules. Any additiional information you need will be provided. Thanks, Abdul -- View this message in context: http://drools.46999.n3.nabble.com/How-to-improve-drools-performance-tp3416326p3416326.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Edson Tirelli JBoss Drools Core Development JBoss by Red Hat @ www.jboss.com ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users