NewRelic
|
Public Types | |
enum | FeatureFlag : int { InteractionTracing = 1 << 1, SwiftInteractionTracing = 1 << 2, CrashReporting = 1 << 3, URLSessionInstrumentation = 1 << 4, HttpResponseBodyCapture = 1 << 5, AnalyticsEvents = 1 << 6, ExperimentalNetworkingInstrumentation = 1 << 13 } |
FeatureFlag is used internally by the agents More... | |
enum | NetworkFailureCode : int { Unknown = -1, Cancelled = -999, BadURL = -1000, TimedOut = -1001, UnsupportedURL = -1002, CannotFindHost = -1003, CannotConnectToHost = -1004, DataLengthExceedsMaximum = -1103, NetworkConnectionLost = -1005, DNSLookupFailed = -1006, HTTPTooManyRedirects = -1007, ResourceUnavailable = -1008, NotConnectedToInternet = -1009, RedirectToNonExistentLocation = -1010, BadServerResponse = -1011, UserCancelledAuthentication = -1012, UserAuthenticationRequired = -1013, ZeroByteResource = -1014, CannotDecodeRawData = -1015, CannotDecodeContentData = -1016, CannotParseResponse = -1017, InternationalRoamingOff = -1018, CallIsActive = -1019, DataNotAllowed = -1020, RequestBodyStreamExhausted = -1021, FileDoesNotExist = -1100, FileIsDirectory = -1101, NoPermissionsToReadFile = -1102, SecureConnectionFailed = -1200, ServerCertificateHasBadDate = -1201, ServerCertificateUntrusted = -1202, ServerCertificateHasUnknownRoot = -1203, ServerCertificateNotYetValid = -1204, ClientCertificateRejected = -1205, ClientCertificateRequired = -1206, CannotLoadFromNetwork = -2000, CannotCreateFile = -3000, CannotOpenFile = -3001, CannotCloseFile = -3002, CannotWriteToFile = -3003, CannotRemoveFile = -3004, CannotMoveFile = -3005, DownloadDecodingFailedMidStream = -3006, DownloadDecodingFailedToComplete = -3007 } |
Network failure codes are used to map networking errors when using noticeNetworkFailure(...) used the value that best describes your network error More... | |
enum | AgentLogLevel : int { NONE = 0, ERROR = 1, WARNING = 2, INFO = 3, VERBOSE = 4, DEBUG = 5 } |
used internally | |
enum | NRTraceType : int { None = 0, ViewLoading, Layout, Database, Images, Json, Network } |
enum | MetricUnit : int { PERCENT, BYTES, SECONDS, BYTES_PER_SECOND, OPERATIONS } |
Static Public Member Functions | |
static void | CrashNow (string message) |
Used to test New Relic crash reporting. Calling this message will cause an immediate crash More... | |
static void | EnableFeatures (int features) |
used internally More... | |
static void | DisableFeatures (int features) |
used internally More... | |
static void | EnableCrashReporting (bool enabled) |
used internally More... | |
static void | SetApplicationVersion (string version) |
used internally More... | |
static void | SetApplicationBuild (string buildNumber) |
used internally More... | |
static string | CurrentSessionId () |
returns the current session idetifier used by New Relic. More... | |
static string | StartInteractionWithName (string name) |
This method will start an interaction trace using name as the name shown in New Relic. The interaction will record all instrumented methods until a timout occurs or More... | |
static void | StopCurrentInteraction (string interactionIdentifier) |
This method will stop the Interaction trace associated with interactionIdentifier which is returned by StartInteractionWithName() It's not necessary to call this method to complete an interaction trace. (An interaction trace will intelligently complete on its own.) However, use this method if you want a more discrete interaction period. More... | |
static void | StartTracingMethod (String methodName, string className, Timer timer, NRTraceType category) |
This method adds a new method trace to the currently running Interaction Trace. If no interaction trace is running, nothing will happen. This method should be called at the beginning of the method you wish to instrument. The timer parameter is a New Relic defined object that only needs to be created just prior to calling this method and must stay in memory until it is passed to the endTracingMethodWithTimer() method call at the end of the custom instrumented method. More... | |
static void | EndTracingMethodWithTimer (Timer timer) |
This method should be called at the end of any method you instrument with startTracingMethod() . Failure to do so will result in an unhealthy trace timeout of the currently running interaction. If no interaction is running this method is a no-op. More... | |
static void | RecordMetricWithName (string name, string category) |
This method will record a metric without units and a value of 1 More... | |
static void | RecordMetricWithName (string name, string category, double value) |
This method will record a metric without units More... | |
static void | RecordMetricWithName (string name, string category, double value, MetricUnit valueUnits) |
This method adds on the last with the addition of setting the value Unit The unit names may be mixed case and must consist strictly of alphabetical characters as well as the _, % and / symbols. Case is preserved. Recommendation: Use uncapitalized words, spelled out in full. For example, use second not Sec. While there are a few predefined units please feel free to add your own by typecasting an NSString. More... | |
static void | RecordMetricWithName (string name, string category, double value, MetricUnit valueUnits, MetricUnit countUnits) |
This method adds on the last with the addition of setting the optional parameter countUnits. The unit names may be mixed case and must consist strictly of alphabetical characters as well as the _, % and / symbols. Case is preserved. Recommendation: Use uncapitalized words, spelled out in full. For example, use second not Sec. While there are a few predefined units please feel free to add your own by typecasting an NSString. More... | |
static void | NoticeNetworkRequest (string URL, string httpMethod, Timer timer, Dictionary< string, object > headers, int httpStatusCode, int bytesSent, int bytesReceived, byte[] responseData, Dictionary< string, object > parameters) |
New Relic will track the URL, response time, status code, and data send/received. If the response headers dictionary contains a X-NewRelic-AppData header, New Relic will track the association between the mobile app and the web server and display the correlation and the server vs. network vs. queue time in the New Relic UI. More... | |
static void | NoticeNetworkFailure (string url, string httpMethod, Timer timer, NewRelicAgent.NetworkFailureCode failureCode, string message) |
records a failed network transaction. More... | |
static bool | RecordEvent (string name, Dictionary< string, object > attributes) |
Records an Insights Event More... | |
static void | SetMaxEventPoolSize (uint size) |
Sets the size of the max event pool. default 1000 events at a time. if more events are recorded before maxEventBufferTime seconds elapsed, events will be sampled using a Reservoir Sampling algorithm. If maxEventBufferTime seconds elapse, the existing event buffer will be transmitted and then emptied. More... | |
static void | SetMaxEventBufferTime (uint seconds) |
Change the maximum length of time before the SDK sends queued events to New Relic. the default timeout is 600 seconds. If the user keeps your app open for longer than that, any stored events will be transmitted and the timer resets. More... | |
static bool | SetAttribute (string name, string value) |
records an attribute that will be added to all events in this app install More... | |
static bool | SetAttribute (string name, double value) |
records an attribute that will be added to all events in this app install More... | |
static bool | IncrementAttribute (string name) |
increments an attribute that will be added to all events in this app install if no attribute exists one will be created with value of 1 More... | |
static bool | IncrementAttribute (string name, double amount) |
increments an attribute that will be added to all events in this app install if no attribute exists one will be created with value of amount More... | |
static bool | RemoveAttribute (string name) |
Removes the attribute with name More... | |
static bool | RemoveAllAttributes () |
Removes all attributes. More... | |
Public Attributes | |
string | iOSApplicationToken = "<NewRelicAppToken>" |
The application token provided by NewRelic Set through the Unity object interface More... | |
string | androidApplicationToken = "<NewRelicAppToken>" |
string | applicationVersion = "" |
The application version. Default to value set by Unity To override the default value set this field through the Unity object interface. More... | |
string | applicationBuild = "" |
The application build. default to value set by Unity To override the default value set this field through the Unity object interface. More... | |
AgentLogLevel | logLevel = AgentLogLevel.ERROR |
The detail of logging provided by New Relic for internal operations. defaults to ERROR More... | |
Boolean | usingSSL = true |
Enable or disable SSL for New Relic data posts defaults to true More... | |
Boolean | crashReporting = true |
Enable or disable New Relic crash reporting defaults to true More... | |
Boolean | httpResponseBodyCapture = true |
enable or disable http response body capture. New Relic will capture a portion of http response bodies to allow for http error debugging. defaults to true More... | |
Boolean | analyticsEvents = true |
enable or disable Insights events, allows for custom events to be recorded as well defaults to true (only settable in Android) More... | |
Protected Attributes | |
NewRelic | agentInstance = null |
String | interactionId = null |
Static Protected Attributes | |
static NewRelicAgent | instance = null |
|
strong |
FeatureFlag
is used internally by the agents
|
strong |
Network failure codes are used to map networking errors when using noticeNetworkFailure(...)
used the value that best describes your network error
|
inlinestatic |
Used to test New Relic crash reporting. Calling this message will cause an immediate crash
message | Exception error message |
|
inlinestatic |
returns the current session idetifier used by New Relic.
|
inlinestatic |
used internally
features | a bit-wise ored value indicating which features should be disabled |
|
inlinestatic |
used internally
enabled | If set to true enabled. |
|
inlinestatic |
used internally
features | a bit-wise ored value indicating which features should be enabled |
|
inlinestatic |
This method should be called at the end of any method you instrument with startTracingMethod()
. Failure to do so will result in an unhealthy trace timeout of the currently running interaction. If no interaction is running this method is a no-op.
timer | The timer used in the StartTracingMethod() |
|
inlinestatic |
increments an attribute that will be added to all events in this app install if no attribute exists one will be created with value of 1
true
, if attribute was set, false
otherwise.name | the attribute name |
|
inlinestatic |
increments an attribute that will be added to all events in this app install if no attribute exists one will be created with value of amount
true
, if attribute was incremented, false
otherwise.name | Name. |
amount | Amount. |
|
inlinestatic |
records a failed network transaction.
url | the URL of the request |
httpMethod | HTTP method |
timer | a timer created when the network request was started |
failureCode | Failure code defined from NewRelicAgent.NetworkFailureCode list |
message | optional descriptive message, unused in iOS |
|
inlinestatic |
New Relic will track the URL, response time, status code, and data send/received. If the response headers dictionary contains a X-NewRelic-AppData header, New Relic will track the association between the mobile app and the web server and display the correlation and the server vs. network vs. queue time in the New Relic UI.
If the HTTP status code indicates an error (400 and above) New Relic will also track this request as a server error, optionally capturing the response type and encoding from the headers dictionary and the response body data as a
URL | the URL of the request |
httpMethod | HTTP method |
timer | A timer created when the network request started |
headers | Headers dictionary (optional) |
httpStatusCode | http response code |
bytesSent | Bytes sent. |
bytesReceived | Bytes received. |
responseData | Response data. |
parameters | unused |
|
inlinestatic |
Records an Insights Event
true
, if event was recorded, false
otherwise.name | Name of the event. Will be stored in the 'category' attribute of Mobile events in New Relic Insights |
attributes | dictionary of attributes associated with the event. Attributes must be a string or numeric value. |
|
inlinestatic |
This method will record a metric without units and a value of 1
name | the metric name. |
category | a descriptive category |
|
inlinestatic |
This method will record a metric without units
name | the metric name |
category | a descriptive category |
value | the value to record. |
|
inlinestatic |
This method adds on the last with the addition of setting the value Unit The unit names may be mixed case and must consist strictly of alphabetical characters as well as the _, % and / symbols. Case is preserved. Recommendation: Use uncapitalized words, spelled out in full. For example, use second not Sec. While there are a few predefined units please feel free to add your own by typecasting an NSString.
name | the metric name |
category | a descriptive category |
value | the value to record. |
valueUnits | the units of value |
|
inlinestatic |
This method adds on the last with the addition of setting the optional parameter countUnits. The unit names may be mixed case and must consist strictly of alphabetical characters as well as the _, % and / symbols. Case is preserved. Recommendation: Use uncapitalized words, spelled out in full. For example, use second not Sec. While there are a few predefined units please feel free to add your own by typecasting an NSString.
name | the metric name |
category | a descriptive category |
value | the value to record. |
valueUnits | the units of value |
countUnits | represents the unit of the metric |
|
inlinestatic |
Removes all attributes.
true
, if all attributes was removed, false
otherwise.
|
inlinestatic |
Removes the attribute with name
true
, if attribute was removed, false
otherwise.name | Name. |
|
inlinestatic |
used internally
buildNumber | will replace the default build number New Relic will report for this app |
|
inlinestatic |
used internally
version | will replace the default version New Relic will report for this app |
|
inlinestatic |
records an attribute that will be added to all events in this app install
true
, if attribute was set, false
otherwise.name | the attribute name |
value | the attribute value |
|
inlinestatic |
records an attribute that will be added to all events in this app install
true
, if attribute was set, false
otherwise.name | the attribute name |
value | the attribute value |
|
inlinestatic |
Change the maximum length of time before the SDK sends queued events to New Relic. the default timeout is 600 seconds. If the user keeps your app open for longer than that, any stored events will be transmitted and the timer resets.
seconds | max event buffer time |
|
inlinestatic |
Sets the size of the max event pool. default 1000 events at a time. if more events are recorded before maxEventBufferTime
seconds elapsed, events will be sampled using a Reservoir Sampling algorithm. If maxEventBufferTime
seconds elapse, the existing event buffer will be transmitted and then emptied.
size | max even pool size. |
|
inlinestatic |
This method will start an interaction trace using name
as the name shown in New Relic. The interaction will record all instrumented methods until a timout occurs or
stopCurrentInteraction
is called.
name | Name. |
|
inlinestatic |
This method adds a new method trace to the currently running Interaction Trace. If no interaction trace is running, nothing will happen. This method should be called at the beginning of the method you wish to instrument. The timer parameter is a New Relic defined object that only needs to be created just prior to calling this method and must stay in memory until it is passed to the endTracingMethodWithTimer()
method call at the end of the custom instrumented method.
methodName | the method name we are tracing |
className | the class owning the method |
timer | timer object used to time the method |
category | a category defined by NRTraceType |
|
inlinestatic |
This method will stop the Interaction trace associated with interactionIdentifier
which is returned by StartInteractionWithName()
It's not necessary to call this method to complete an interaction trace. (An interaction trace will intelligently complete on its own.) However, use this method if you want a more discrete interaction period.
interactionIdentifier | an identifier generated by StartInteractionWithName() |
Boolean NewRelicAgent.analyticsEvents = true |
enable or disable Insights events, allows for custom events to be recorded as well defaults to true
(only settable in Android)
string NewRelicAgent.applicationBuild = "" |
The application build. default to value set by Unity To override the default value set this field through the Unity object interface.
string NewRelicAgent.applicationVersion = "" |
The application version. Default to value set by Unity To override the default value set this field through the Unity object interface.
Boolean NewRelicAgent.crashReporting = true |
Enable or disable New Relic crash reporting defaults to true
Boolean NewRelicAgent.httpResponseBodyCapture = true |
enable or disable http response body capture. New Relic will capture a portion of http response bodies to allow for http error debugging. defaults to true
string NewRelicAgent.iOSApplicationToken = "<NewRelicAppToken>" |
The application token provided by NewRelic Set through the Unity object interface
AgentLogLevel NewRelicAgent.logLevel = AgentLogLevel.ERROR |
The detail of logging provided by New Relic for internal operations. defaults to ERROR
Boolean NewRelicAgent.usingSSL = true |
Enable or disable SSL for New Relic data posts defaults to true