Package com.appoptics.api.ext
Class AgentChecker
- java.lang.Object
-
- com.appoptics.api.ext.AgentChecker
-
public class AgentChecker extends java.lang.Object
Checker to ensure agent is available and ready to report data
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
REQUIRED_AGENT_VERSION
-
Constructor Summary
Constructors Constructor Description AgentChecker()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isAgentAvailable()
Returns whether the java agent is available via -javaagent.static boolean
waitUntilAgentReady(long timeout, java.util.concurrent.TimeUnit unit)
Blocks until agent is ready (established connection with data collector) or timeout expired.
-
-
-
Field Detail
-
REQUIRED_AGENT_VERSION
public static final java.lang.String REQUIRED_AGENT_VERSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
isAgentAvailable
public static boolean isAgentAvailable()
Returns whether the java agent is available via -javaagent. If the agent is not available, api calls will be ignored- Returns:
-
waitUntilAgentReady
public static boolean waitUntilAgentReady(long timeout, java.util.concurrent.TimeUnit unit)
Blocks until agent is ready (established connection with data collector) or timeout expired. Take note that if an agent is not ready, traces and metrics collected will not be processed. Call this method to ensure agent is ready before reporting traces for one-off batch jobs- Parameters:
timeout
-unit
-- Returns:
- whether the agent is ready
-
-