To count the number of LHS clauses that are evaluated, you can subscribe like this:
void CreateSession()
{
ISession session = = sessionFactory.CreateSession();
session.Events.LhsExpressionEvaluatedEvent += DebugOnLHSExpressionEvaluated;
}
void DebugOnLHSExpressionEvaluated(object sender, LhsExpressionEventArgs e)
{
// count or use event args here - this will be called each time an LHS clause is evaluated
}
It's a relatively new event added to ISession, so you may need to update your version of NRules. For starters you can add a simple counter that you increment each time this action is invoked, to see how the number of clause evaluations is growing as you add more facts.
As for evaluating the performance of groupby itself I was just suggesting that you try incrementing a counter in the accessor for your pw.IssuerId.Value to see how many times its called during the insert of your facts. I have a suspicion that groupby may be called a logarithmically increasing number of times as your collection grows, but not sure. You'd need to track it to see.
Hope that all makes sense!