com.newrelic.agent.security.util.AgentUsageMetric Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of newrelic-security-agent Show documentation
Show all versions of newrelic-security-agent Show documentation
The New Relic Security Java agent module for full-stack security. To be used in newrelic-java-agent only.
The newest version!
package com.newrelic.agent.security.util;
import com.newrelic.agent.security.instrumentator.dispatcher.DispatcherPool;
import com.newrelic.agent.security.intcodeagent.websocket.EventSendPool;
public class AgentUsageMetric {
public static Boolean isRASPProcessingActive() {
if(EventSendPool.getInstance().getExecutor().getQueue().size() >
EventSendPool.getInstance().getMaxQueueSize()/2){
return false;
}
if(DispatcherPool.getInstance().getExecutor().getQueue().size() >
DispatcherPool.getInstance().getMaxQueueSize()*2/3){
return false;
}
return true;
}
public static Boolean isIASTRequestProcessingActive() {
if(EventSendPool.getInstance().getExecutor().getQueue().size() >
EventSendPool.getInstance().getMaxQueueSize()*2/3){
return false;
}
if(DispatcherPool.getInstance().getExecutor().getQueue().size() >
DispatcherPool.getInstance().getMaxQueueSize()*0.75){
return false;
}
return true;
}
}