added conditions for printing schedule logs
This commit is contained in:
		
							parent
							
								
									93cc222ab9
								
							
						
					
					
						commit
						a6f7388c61
					
				@ -298,8 +298,10 @@ public class ActorSystemContext {
 | 
			
		||||
    @Scheduled(fixedDelayString = "${js.remote.stats.print_interval_ms}")
 | 
			
		||||
    public void printStats() {
 | 
			
		||||
        if (statisticsEnabled) {
 | 
			
		||||
            log.info("Rule Engine JS Invoke Stats: requests [{}] responses [{}] failures [{}]",
 | 
			
		||||
                    jsInvokeRequestsCount.getAndSet(0), jsInvokeResponsesCount.getAndSet(0), jsInvokeFailuresCount.getAndSet(0));
 | 
			
		||||
            if (jsInvokeRequestsCount.get() > 0 || jsInvokeResponsesCount.get() > 0 || jsInvokeFailuresCount.get() > 0) {
 | 
			
		||||
                log.info("Rule Engine JS Invoke Stats: requests [{}] responses [{}] failures [{}]",
 | 
			
		||||
                        jsInvokeRequestsCount.getAndSet(0), jsInvokeResponsesCount.getAndSet(0), jsInvokeFailuresCount.getAndSet(0));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -92,8 +92,10 @@ public class TbSqlBlockingQueue<E> implements TbSqlQueue<E> {
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        logExecutor.scheduleAtFixedRate(() -> {
 | 
			
		||||
            log.info("[{}] queueSize [{}] totalAdded [{}] totalSaved [{}] totalFailed [{}]",
 | 
			
		||||
                    params.getLogName(), queue.size(), addedCount.getAndSet(0), savedCount.getAndSet(0), failedCount.getAndSet(0));
 | 
			
		||||
            if (queue.size() > 0 || addedCount.get() > 0 || savedCount.get() > 0 || failedCount.get() > 0) {
 | 
			
		||||
                log.info("[{}] queueSize [{}] totalAdded [{}] totalSaved [{}] totalFailed [{}]",
 | 
			
		||||
                        params.getLogName(), queue.size(), addedCount.getAndSet(0), savedCount.getAndSet(0), failedCount.getAndSet(0));
 | 
			
		||||
            }
 | 
			
		||||
        }, params.getStatsPrintIntervalMs(), params.getStatsPrintIntervalMs(), TimeUnit.MILLISECONDS);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user