public class Instrumentation
extends java.lang.Object
This class provides the following functionality
NetworkRequestEvent
ErrorEvent
CustomEvent
Modifier and Type | Class and Description |
---|---|
static class |
Instrumentation.Severity |
static class |
Instrumentation.State |
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOGGER |
Constructor and Description |
---|
Instrumentation() |
Modifier and Type | Method and Description |
---|---|
static void |
addErrorEvent(java.lang.Throwable throwable,
Instrumentation.Severity level) |
static void |
addEvent(Event event) |
static HttpRequestTracker |
beginHttpRequest(java.net.URL url) |
static boolean |
isAppKeyEnabledOnCloud()
This call syncs the instrumentation runtime with the cloud for the appkey being used and returns true if
the AppKey is enabled and the backend is ready to accept event data.
|
static boolean |
isDisabled()
If the controller sends a responseCode of 402, 403 or 429 to the app when it calls
sendAllEvents() , the
instrumentation runtime is put in a disabled state and the following calls become no-ops. |
static void |
sendAllEvents()
This method sends all collected beacons to the AppDynamics Collector
It flushes the in memory buffer after that
If a CollectorChannel is set, the Beacons are sent over that
If not, the default transport bundled with the SDK is used.
|
static void |
start(AgentConfiguration configuration,
DeviceInfo deviceInfo,
VersionInfo versionInfo) |
public static void start(AgentConfiguration configuration, DeviceInfo deviceInfo, VersionInfo versionInfo)
configuration
- Configuration of the AgentdeviceInfo
- information about the deviceversionInfo
- version info about theAgentConfiguration
,
DeviceInfo
,
VersionInfo
public static boolean isDisabled()
sendAllEvents()
, the
instrumentation runtime is put in a disabled state and the following calls become no-ops.
addEvent(Event)
,
addErrorEvent(Throwable, Severity)
,
beginHttpRequest(URL)
,
sendAllEvents()
The current state of the APPKEY on the controller can be checked by calling
isAppKeyEnabledOnCloud()
public static HttpRequestTracker beginHttpRequest(java.net.URL url)
url
- The URL of the Http Network Request being trackedpublic static void addErrorEvent(java.lang.Throwable throwable, Instrumentation.Severity level)
throwable
- Report a throwable. If null, this method does nothing.level
- Level of the Error
Instrumentation.Severity.ALERT
An error that didn't cause any issuesInstrumentation.Severity.CRITICAL
An error that caused issuesInstrumentation.Severity.FATAL
An error that killed the apppublic static void addEvent(Event event)
event
- a user defined eventEvent
public static void sendAllEvents()
isAppKeyEnabledOnCloud()
CollectorChannelFactory
,
isDisabled()
public static boolean isAppKeyEnabledOnCloud()
Instrumentation.State
,
isDisabled()