public final class APM
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static long |
EVENT_ERROR
predefined events:
the following events are implicitly available under
all modules
|
static long |
EVENT_INFO |
static byte |
EVENT_LEVEL_DEBUG |
static byte |
EVENT_LEVEL_DETAIL |
static byte |
EVENT_LEVEL_IPC |
static byte |
EVENT_LEVEL_LOG
predefined event log levels
|
static byte |
EVENT_LEVEL_NORMAL |
static long |
EVENT_OS_CLOSE |
static long |
EVENT_OS_COPY |
static long |
EVENT_OS_CREATE |
static long |
EVENT_OS_CRITICALSECTION_ENTER |
static long |
EVENT_OS_CRITICALSECTION_LEAVE |
static long |
EVENT_OS_CRITICALSECTION_WAIT |
static long |
EVENT_OS_DELETE |
static long |
EVENT_OS_EXECUTE |
static long |
EVENT_OS_FLUSH |
static long |
EVENT_OS_LOCK |
static long |
EVENT_OS_MOVE |
static long |
EVENT_OS_OPEN |
static long |
EVENT_OS_READ |
static long |
EVENT_OS_RENAME |
static long |
EVENT_OS_SLEEP |
static long |
EVENT_OS_UNLOCK |
static long |
EVENT_OS_WAIT |
static long |
EVENT_OS_WRITE |
static long |
EVENT_PARENT_SEQUENCE
Deprecated.
|
static long |
EVENT_REQUEST_SEQUENCE
Deprecated.
|
static long |
EVENT_SEQUENCE_NAME
Deprecated.
|
static long |
EVENT_TRACE |
static long |
EVENT_WARNING |
static long |
EVENT_XMLHTTP_COMPLETE |
static long |
EVENT_XMLHTTP_INTERACTIVE |
static long |
EVENT_XMLHTTP_LOADED |
static long |
EVENT_XMLHTTP_LOADING |
static long |
EVENT_XMLHTTP_PROCESSED |
static long |
EVENT_XMLHTTP_PROCESSING |
static long |
EVENT_XMLHTTP_SEND |
static byte |
FLAG_ENTER |
static byte |
FLAG_ERROR |
static byte |
FLAG_LEAVE |
static byte |
FLAG_NONE
event flag masks
use this flags in flags parameter of the event functions
|
static byte |
FLAG_PROCESS_INFO |
static byte |
FLAG_WAIT |
static byte |
FLAG_WARNING |
static java.lang.String |
MODULE_NAME_OS
predefined modules
applications may use predefined modules and events
to use a predefined module, register a APMModule with
the respective name.
|
static java.lang.String |
MODULE_NAME_XMLHTTP |
Modifier and Type | Method and Description |
---|---|
long |
AttachContextTx(long thread,
byte[] context)
Call AttachContextTx to restore the context acquired through GetContext in another thread or process.
|
long |
CreateContextTx(long thread,
java.lang.String filterValue)
Call CreateContextTx to create a new Software-Telemetry context.
|
static APMReportContent |
createScreenshot(android.view.View view)
Helper function to create a screenshot of the current application.
|
byte[] |
GetContextTx(long thread)
Call GetContextTx to get a context handle, which can be passed to another
threads or processes.
|
static APM |
getInstance()
get the static APM instance
|
static APMModule |
getModule(java.lang.String name)
get the static module object by name
|
byte[] |
GetSyncMarkTx(long thread)
Call GetSyncMarkTx to get a synchronization handle that can be passed to
another thread or process to synchronize control flow.
|
boolean |
HasActiveContextTx(long thread,
byte level)
Call HasActiveContextTx to test, if a software-telemetry session is active
for some logging level.
|
static void |
init(android.app.Application appContext,
java.lang.String url)
initialize the static APM instance with a default transport
|
static void |
init(android.app.Application appContext,
java.lang.String url,
org.apache.http.client.HttpClient client)
initialize the static APM instance with a default transport
|
boolean |
IsConnected()
Call IsConnected to test, if the application has successfully registered
to an APM agent.
|
int |
RegisterApplication(java.lang.String applicationName,
java.lang.String applicationId,
java.lang.String applicationTierName,
java.lang.String applicationTierId)
Call Register once to register a new Software-Telemetry application.
|
void |
RegisterFilterValue(java.lang.String filterValue,
java.lang.String filterDescription)
Call RegisterFilterValue for each valid filter value.
|
void |
ReleaseContextTx(long thread)
Call ReleaseContextTx to finish logging and to flush logged information to
the app.telemetry infrastructure.
|
void |
ReportContent(java.lang.String reportKey,
APMReportContent content)
Call ReportContent and pass a content (e.g.
|
void |
ReportContent(java.lang.String reportKey,
java.lang.String filename,
java.lang.String mimetype,
byte[] content)
Call ReportContent to add binary values to a previously created feedback report.
|
void |
ReportTx(long thread,
java.lang.String filterValue,
java.lang.String reportKey,
java.lang.String description)
Call ReportTx to create a new feedback report.
|
void |
ReportValueTx(long thread,
java.lang.String reportKey,
java.lang.String key,
java.lang.String value)
Call ReportValueTx to add values to a previously created feedback report.
|
void |
SetSyncMarkTx(long thread,
byte[] token)
Call SetSyncMarkTx to pass a synchronization handle you got from
GetSyncMark for synchronizing the sequence of events.
|
static void |
setURL(java.lang.String url)
setURL can be used to change the URL that is used to send the telemetry data after the APM API has been initialized,
if the URL is the same as the URL that has been used to initialize the APM API this method does nothing.
|
static void |
setURL(java.lang.String url,
org.apache.http.client.HttpClient client)
setURL can be used to change the URL and HttpClient that is used to send the telemetry data after the APM API has been initialized.
|
public static final byte EVENT_LEVEL_LOG
public static final byte EVENT_LEVEL_IPC
public static final byte EVENT_LEVEL_NORMAL
public static final byte EVENT_LEVEL_DETAIL
public static final byte EVENT_LEVEL_DEBUG
public static final byte FLAG_NONE
public static final byte FLAG_ENTER
public static final byte FLAG_LEAVE
public static final byte FLAG_WAIT
public static final byte FLAG_WARNING
public static final byte FLAG_ERROR
public static final byte FLAG_PROCESS_INFO
public static final java.lang.String MODULE_NAME_OS
public static final long EVENT_OS_CREATE
public static final long EVENT_OS_OPEN
public static final long EVENT_OS_DELETE
public static final long EVENT_OS_READ
public static final long EVENT_OS_WRITE
public static final long EVENT_OS_CLOSE
public static final long EVENT_OS_FLUSH
public static final long EVENT_OS_RENAME
public static final long EVENT_OS_COPY
public static final long EVENT_OS_MOVE
public static final long EVENT_OS_LOCK
public static final long EVENT_OS_UNLOCK
public static final long EVENT_OS_EXECUTE
public static final long EVENT_OS_WAIT
public static final long EVENT_OS_SLEEP
public static final long EVENT_OS_CRITICALSECTION_WAIT
public static final long EVENT_OS_CRITICALSECTION_ENTER
public static final long EVENT_OS_CRITICALSECTION_LEAVE
public static final java.lang.String MODULE_NAME_XMLHTTP
public static final long EVENT_XMLHTTP_SEND
public static final long EVENT_XMLHTTP_LOADING
public static final long EVENT_XMLHTTP_LOADED
public static final long EVENT_XMLHTTP_INTERACTIVE
public static final long EVENT_XMLHTTP_COMPLETE
public static final long EVENT_XMLHTTP_PROCESSING
public static final long EVENT_XMLHTTP_PROCESSED
public static final long EVENT_ERROR
public static final long EVENT_WARNING
public static final long EVENT_INFO
public static final long EVENT_TRACE
@Deprecated public static final long EVENT_REQUEST_SEQUENCE
@Deprecated public static final long EVENT_SEQUENCE_NAME
@Deprecated public static final long EVENT_PARENT_SEQUENCE
public static void init(android.app.Application appContext, java.lang.String url)
appContext
- url
- URL of the app.telemetry WebAPI webservice where the data should be sentpublic static void init(android.app.Application appContext, java.lang.String url, org.apache.http.client.HttpClient client) throws java.lang.IllegalArgumentException
appContext
- url
- URL of the app.telemetry WebAPI webservice where the data should be sentclient
- custom HttpClient for example to allow https connection to test servers, or custom authentication methodsjava.lang.IllegalArgumentException
- if the given URL is not absolute or invalidpublic static void setURL(java.lang.String url) throws java.lang.IllegalArgumentException
url
- new URL of the app.telemetry WebAPI webservice where the data should be sentjava.lang.IllegalArgumentException
- if the given URL is not absolute or invalidpublic static void setURL(java.lang.String url, org.apache.http.client.HttpClient client) throws java.lang.IllegalArgumentException
url
- new URL of the app.telemetry WebAPI webservice where the data should be sentclient
- custom HttpClient for example to allow https connection to test servers, or custom authentication methods. If client is null a default HttpClient will be created.java.lang.IllegalArgumentException
- if the given URL is not absolute or invalidpublic static APM getInstance()
public static APMModule getModule(java.lang.String name)
name
- public boolean IsConnected()
public int RegisterApplication(java.lang.String applicationName, java.lang.String applicationId, java.lang.String applicationTierName, java.lang.String applicationTierId)
applicationName
- (String) The name of the application.applicationId
- (String) The ID of the application.applicationTierName
- (String) For multi-tiered applications pass the name of the tier to be registered.applicationTierId
- (String) For multi-tiered applications pass the ID of the tier to be registered.
This ID needs to be unique for a certain applTier.public void RegisterFilterValue(java.lang.String filterValue, java.lang.String filterDescription)
filterValue
- Filter string that identifies the filter.filterDescription
- Description string of the filter.public long CreateContextTx(long thread, java.lang.String filterValue)
thread
- Handle of an existing valid context or 0 for a new contextfilterValue
- Filter string valid for the context to be created.public long AttachContextTx(long thread, byte[] context)
thread
- Handle of an existing valid context or 0 for a new contextcontext
- Context handle.public byte[] GetContextTx(long thread)
thread
- Handle of an existing valid context.public void ReleaseContextTx(long thread)
thread
- Handle of an existing valid context.public byte[] GetSyncMarkTx(long thread)
thread
- Handle of an existing valid context.public void SetSyncMarkTx(long thread, byte[] token)
thread
- Handle of an existing valid context.token
- Synchronization handle.public void ReportTx(long thread, java.lang.String filterValue, java.lang.String reportKey, java.lang.String description)
thread
- Handle of an existing valid context or 0.filterValue
- (String) The filter value will be matched to the description
using the registered filter values.reportKey
- (String) A key value generated by the calling application
to associate further descriptions to a feedback.description
- (String) Textual description of the feedback entered by the
user or generated by the application.public void ReportValueTx(long thread, java.lang.String reportKey, java.lang.String key, java.lang.String value)
thread
- Handle of an existing valid context or 0.reportKey
- (String) The reportkey parameter of the previously issued Report function callkey
- (String) Key of the Key/Value pairvalue
- (String) Value of the Key/Value pairpublic void ReportContent(java.lang.String reportKey, java.lang.String filename, java.lang.String mimetype, byte[] content)
reportKey
- (String) The reportkey parameter of the previously issued Report function callfilename
- (String) Filename to store the content undermimetype
- (String) MIME-Type of content (e.g.: text/plain, image/png, ...)content
- (byte []) Content valuepublic void ReportContent(java.lang.String reportKey, APMReportContent content)
reportKey
- (String) The reportkey parameter of the previously issued Report function callcontent
- public static APMReportContent createScreenshot(android.view.View view)
view
- (any view object of the currently displayed app)public boolean HasActiveContextTx(long thread, byte level)
thread
- Handle of an existing valid context.level
- Logging level to be checked.Copyright (c) Fabasoft R&D GmbH, Linz, Austria, 1988-2015.