Inherits from NSObject
Declared in APSPerformance.h

Overview

The APSPerformance class provides a centralized point of control and coordination for real-time crash reporting and app monitoring to capture errors and provide valuable diagnostic information of your mobile application. This information is sent to your Performance Dashboard in real-time.

All that is required to start collecting this valuable data and visualizing it on your Performance Dashboard is calling the method configureWithAppKey: on the singleton instance of this class.

The shared instance of this class is thread safe, and may be called from any thread.

Your own custom data may be sent to your Performance Dashboard in addition to what Appcelerator collects and sends. For example, this is how you would display the game level in your app:

 [APSPerformance sharedInstance][@"Game Level"] = @(10);

For information on getting started with Appcelerator Platform Services, see Appcelerator Platform Services Native SDKs.

Tasks

  • + sharedInstance

    Returns the singleton instance to the real-time diagnostic service.

  •   optOut

    Set to NO (the default) to send diagnostic data to your Performance Dashboard.

    property
  •   username

    An optional username to help you differentiate metadata for crash reports. The maximum length of the username is 32 characters. There is no default value, and if no value is set then nil is returned.

    property
  •   didCrashOnLastAppLoad

    Returns YES if the application crashed on the last launch of your app. The value NO is returned if the app crashed on previous launch and optOut was set to YES.

    property
  •   uniqueIdentifier

    The unique identifier generated by the Performance Service to identify your app’s diagnostic data.

    property
  •   asyncBreadcrumbMode

    This is an advanced option that has a suitable default.

    property
  • – leaveBreadcrumb:

    Adds a breadcrumb to a breadcrumb trail in your app, which allows you to obtain a playback of events leading up to a crash. The 99 most recent breadcrumbs before the occurence of a crash are displayed on your Performance Dashboard. A breadcrumb can have a maximum length of 140 characters.

  • – logHandledException:

    Adds an exception you caught to an exception queue that can hold up to five exceptions. The tail of this queue is popped and sent to your Performance Dashboard once per minute.

  • – objectForKeyedSubscript:

    Retrieves a local in-memory cache of custom metadata you have sent to your Performance Dashboard. This is an implementation of Custom Keyed Subscripting.

  • – setObject:forKeyedSubscript:

    Adds custom metadata to your Performance Dashboard using Custom Keyed Subscripting.

Properties

asyncBreadcrumbMode

This is an advanced option that has a suitable default.

@property (atomic, assign, readwrite, getter=isAsyncBreadcrumbMode) BOOL asyncBreadcrumbMode

Discussion

This is an advanced option that has a suitable default.

Set to NO (the default) to persist breadcrumbs synchronously, which provides the most accurate breadcrumb trail leading up to a crash.

Set to YES only if you measure a performance issue with leaving breadcrumbs, which may improve the performance of persisting breadcrumbs at the cost of possibly loosing some immediately before a crash.

Declared In

APSPerformance.h

didCrashOnLastAppLoad

Returns YES if the application crashed on the last launch of your app. The value NO is returned if the app crashed on previous launch and optOut was set to YES.

@property (atomic, assign, readonly, getter=didCrashOnLastAppLoad) BOOL didCrashOnLastAppLoad

Discussion

Returns YES if the application crashed on the last launch of your app. The value NO is returned if the app crashed on previous launch and optOut was set to YES.

Declared In

APSPerformance.h

optOut

Set to NO (the default) to send diagnostic data to your Performance Dashboard.

@property (atomic, assign, readwrite, getter=isOptOut) BOOL optOut

Discussion

Set to NO (the default) to send diagnostic data to your Performance Dashboard.

Declared In

APSPerformance.h

uniqueIdentifier

The unique identifier generated by the Performance Service to identify your app’s diagnostic data.

@property (atomic, strong, readonly) NSString *uniqueIdentifier

Discussion

The unique identifier generated by the Performance Service to identify your app’s diagnostic data.

Declared In

APSPerformance.h

username

An optional username to help you differentiate metadata for crash reports. The maximum length of the username is 32 characters. There is no default value, and if no value is set then nil is returned.

@property (atomic, strong, readwrite) NSString *username

Discussion

An optional username to help you differentiate metadata for crash reports. The maximum length of the username is 32 characters. There is no default value, and if no value is set then nil is returned.

Declared In

APSPerformance.h

Class Methods

sharedInstance

Returns the singleton instance to the real-time diagnostic service.

+ (instancetype)sharedInstance

Discussion

Returns the singleton instance to the real-time diagnostic service.

Declared In

APSPerformance.h

Instance Methods

leaveBreadcrumb:

Adds a breadcrumb to a breadcrumb trail in your app, which allows you to obtain a playback of events leading up to a crash. The 99 most recent breadcrumbs before the occurence of a crash are displayed on your Performance Dashboard. A breadcrumb can have a maximum length of 140 characters.

- (void)leaveBreadcrumb:(NSString *)breadcrumb

Parameters

breadcrumb

A breadcrumb to add to the breadcrumb trail.

Discussion

Adds a breadcrumb to a breadcrumb trail in your app, which allows you to obtain a playback of events leading up to a crash. The 99 most recent breadcrumbs before the occurence of a crash are displayed on your Performance Dashboard. A breadcrumb can have a maximum length of 140 characters.

Declared In

APSPerformance.h

logHandledException:

Adds an exception you caught to an exception queue that can hold up to five exceptions. The tail of this queue is popped and sent to your Performance Dashboard once per minute.

- (void)logHandledException:(NSException *)exception

Parameters

exception

The exception to add to the queue

Discussion

Adds an exception you caught to an exception queue that can hold up to five exceptions. The tail of this queue is popped and sent to your Performance Dashboard once per minute.

Declared In

APSPerformance.h

objectForKeyedSubscript:

Retrieves a local in-memory cache of custom metadata you have sent to your Performance Dashboard. This is an implementation of Custom Keyed Subscripting.

- (id)objectForKeyedSubscript:(id<NSCopying>)key

Parameters

key

Key of the value to retrieve.

Discussion

Retrieves a local in-memory cache of custom metadata you have sent to your Performance Dashboard. This is an implementation of Custom Keyed Subscripting.

Declared In

APSPerformance.h

setObject:forKeyedSubscript:

Adds custom metadata to your Performance Dashboard using Custom Keyed Subscripting.

- (void)setObject:(id)obj forKeyedSubscript:(id<NSCopying>)key

Parameters

obj

Value of the metadata. Can either be a string or number.

key

Key of the metadata.

Discussion

For example, this is how you would display the game level of your app on your Performance Dashboard:

 [APSPerformance sharedInstance][@"Game Level"] = @(10);

Declared In

APSPerformance.h