public bool TryIncreaseCount(AgentInstanceContext agentInstanceContext) { // test pool max long newMax = _poolCount.IncrementAndGet(); if (newMax > _maxPoolCountConfigured && _maxPoolCountConfigured >= 0) { var counts = GetCounts(); agentInstanceContext.StatementContext.ExceptionHandlingService.HandleCondition(new ConditionMatchRecognizeStatesMax(_maxPoolCountConfigured, counts), agentInstanceContext.StatementContext.EpStatementHandle); if (ExecutionPathDebugLog.IsEnabled && Log.IsDebugEnabled && ExecutionPathDebugLog.IsTimerDebugEnabled) { MatchRecognizeStatePoolStmtHandler stmtHandler = agentInstanceContext.StatementContext.MatchRecognizeStatePoolStmtSvc.StmtHandler; string stmtName = agentInstanceContext.StatementContext.StatementName; Log.Debug(".tryIncreaseCount For statement '" + stmtName + "' pool count overflow at " + newMax + " statement count was " + stmtHandler.Count + " preventStart=" + _preventStart); } if (_preventStart) { _poolCount.DecrementAndGet(); return(false); } else { return(true); } } if (ExecutionPathDebugLog.IsEnabled && Log.IsDebugEnabled) { MatchRecognizeStatePoolStmtHandler stmtHandler = agentInstanceContext.StatementContext.MatchRecognizeStatePoolStmtSvc.StmtHandler; string stmtName = agentInstanceContext.StatementContext.StatementName; Log.Debug(".tryIncreaseCount For statement '" + stmtName + "' pool count increases to " + newMax + " statement count was " + stmtHandler.Count); } return(true); }
private void LogDecrease(AgentInstanceContext agentInstanceContext, long newMax) { if (ExecutionPathDebugLog.IsEnabled && Log.IsDebugEnabled) { MatchRecognizeStatePoolStmtHandler stmtHandler = agentInstanceContext.StatementContext.MatchRecognizeStatePoolStmtSvc.StmtHandler; string stmtName = agentInstanceContext.StatementContext.StatementName; Log.Debug(".decreaseCount For statement '" + stmtName + "' pool count decreases to " + newMax + " statement count was " + stmtHandler.Count); } }
public void AddPatternContext(string statementName, MatchRecognizeStatePoolStmtHandler stmtCounts) { _matchRecognizeContexts.Add(new StatementEntry(statementName, stmtCounts)); }
public StatementEntry(string statementName, MatchRecognizeStatePoolStmtHandler stmtCounts) { StatementName = statementName; StmtCounts = stmtCounts; }