All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.newrelic.agent.security.util.AgentUsageMetric Maven / Gradle / Ivy

Go to download

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;
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy