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: [email protected]
[mailto:[email protected]] On Behalf Of arrehman
Sent: Wednesday, October 12, 2011 1:21 PM
To: [email protected]
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
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users