AppDynamics Xamarin SDK  2021.9.0
Real user monitoring for your Xamarin app.
Static Public Member Functions | Static Public Attributes | Properties | List of all members
AppDynamics.Agent.Instrumentation Class Reference

Interact with the AppDynamics Agent running in your application. More...

Static Public Member Functions

static void InitWithConfiguration (IAgentConfiguration iConfig)
 Initialize agent with an AgentConfiguration. More...
 
static void ChangeAppKey (string appKey)
 Changes the app key. More...
 
static ICallTracker BeginCall (string className, string methodName, params object[] arguments)
 Reports that an info point has started. More...
 
static void EndCall (ICallTracker call, object returnValue=null)
 Reports that an info point has ended. More...
 
static void EndCall (ICallTracker call, Exception e)
 Reports that an info point has ended with an Exception More...
 
static void StartTimerWithName (string name)
 Starts a global timer with the given name. More...
 
static void StopTimerWithName (string name)
 Stops a global timer with the given name and reports it. More...
 
static void ReportMetricWithName (string name, long value)
 Reports metric value for the given name. More...
 
static void LeaveBreadcrumb (string breadcrumb, BreadcrumbVisibility mode=BreadcrumbVisibility.CrashesOnly)
 Leaves a breadcrumb that will appear in a crash report and, optionally, session. More...
 
static void SetUserData (string key, string value)
 Sets a key-value pair identifier that will be included in all snapshots. More...
 
static void RemoveUserData (string key)
 Removes the user data. More...
 
static void SetUserDataLong (string key, long value)
 Sets a key-value pair identifier that will be included in all snapshots. More...
 
static void RemoveUserDataLong (string key)
 Removes the user data. More...
 
static void SetUserDataBoolean (string key, bool value)
 Sets a key-value pair identifier that will be included in all snapshots. More...
 
static void RemoveUserDataBoolean (string key)
 Removes the user data. More...
 
static void SetUserDataDouble (string key, double value)
 Sets a key-value pair identifier that will be included in all snapshots. More...
 
static void RemoveUserDataDouble (string key)
 Removes the user data. More...
 
static void SetUserDataDate (string key, DateTime value)
 Sets a key-value pair identifier that will be included in all snapshots. More...
 
static void RemoveUserDataDate (string key)
 Removes the user data. More...
 
static void ReportError (Exception exception, ErrorSeverityLevel severity)
 Reports an error that was caught. More...
 
static void StartNextSession ()
 Starts next session and ends the current session. More...
 
static ISessionFrame StartSessionFrame (string sessionFrameName)
 Starts a Session Frame. More...
 
static void ShutdownAgent ()
 Stops the sending of beacons to the collector More...
 
static void RestartAgent ()
 Restarts the sending of beacons to the collector. More...
 
static void BlockScreenshots ()
 Blocks screenshot capture if it is currently unblocked. Otherwise, this has no effect.. More...
 
static void UnblockScreenshots ()
 Unblocks screenshot capture if it is currently blocked. Otherwise, this has no effect. More...
 
static void TakeScreenshot ()
 Asynchronously takes a screenshot of the current Activity's window. More...
 

Static Public Attributes

static bool enableAggregateExceptionReporting = false
 Enables or disables the reporting of all exceptions as crashes. More...
 

Properties

static bool ScreenshotsBlocked [get]
 

Detailed Description

Interact with the AppDynamics Agent running in your application.

This class provides a number of methods to interact with the AppDynamics Agent including:

About on-premise deployments: Some of the features described here require a minimum EUM server deployment version. Please refer to the following page for more information: https://docs.appdynamics.com/display/latest/Mobile+Agent+Version+and+Deployment+Support+Matrix

Member Function Documentation

§ BeginCall()

static ICallTracker AppDynamics.Agent.Instrumentation.BeginCall ( string  className,
string  methodName,
params object []  arguments 
)
inlinestatic

Reports that an info point has started.

Returns
The call tracker.
Parameters
classNameThe class containing the info point method.
methodNameThe name of the method that started execution.
argumentsThe arguments passed to this method.

§ BlockScreenshots()

static void AppDynamics.Agent.Instrumentation.BlockScreenshots ( )
inlinestatic

Blocks screenshot capture if it is currently unblocked. Otherwise, this has no effect..

If screenshots are disabled through AgentConfiguration.ScreenshotsEnabled or through the controller UI, this method has no effect.

WARNING: This will block capture for the entire app.

The user is expected to manage any possible nesting issues that may occur if blocking and unblocking occur in different code paths.

See unblockScreenshots

§ ChangeAppKey()

static void AppDynamics.Agent.Instrumentation.ChangeAppKey ( string  appKey)
inlinestatic

Changes the app key.

Older beacons/reports will be discarded when app key is changed.

Invoking this method has no effect unless the agent was already initialized.

Parameters
appKeyApp key.
Exceptions
ExceptionThrown when parameter appKey is not the format of AD-AAA-BBB.

§ EndCall() [1/2]

static void AppDynamics.Agent.Instrumentation.EndCall ( ICallTracker  call,
object  returnValue = null 
)
inlinestatic

Reports that an info point has ended.

Parameters
callCallTracker object.
returnValueThe value returned by the method invocation - can be null.

§ EndCall() [2/2]

static void AppDynamics.Agent.Instrumentation.EndCall ( ICallTracker  call,
Exception  e 
)
inlinestatic

Reports that an info point has ended with an Exception

Parameters
callCallTracker object.
eException that occurred during method invocation.

§ InitWithConfiguration()

static void AppDynamics.Agent.Instrumentation.InitWithConfiguration ( IAgentConfiguration  iConfig)
inlinestatic

Initialize agent with an AgentConfiguration.

See also
AgentConfiguration
Parameters
iConfigConfiguration.

§ LeaveBreadcrumb()

static void AppDynamics.Agent.Instrumentation.LeaveBreadcrumb ( string  breadcrumb,
BreadcrumbVisibility  mode = BreadcrumbVisibility.CrashesOnly 
)
inlinestatic

Leaves a breadcrumb that will appear in a crash report and, optionally, session.

Call this when something interesting happens in your application. The breadcrumb will be included in different reports depending on the mode.

See also
BreadcrumbVisibility

Each crash report displays the most recent 99 breadcrumbs.

Parameters
breadcrumbThe string to include in the crash report and sessions. If it is longer than 2048 characters, it will be truncated.
modeVisibility mode.

§ RemoveUserData()

static void AppDynamics.Agent.Instrumentation.RemoveUserData ( string  key)
inlinestatic

Removes the user data.

See also
SetUserData
Parameters
keyKey.

§ RemoveUserDataBoolean()

static void AppDynamics.Agent.Instrumentation.RemoveUserDataBoolean ( string  key)
inlinestatic

Removes the user data.

See also
SetUserData
Parameters
keyKey.

§ RemoveUserDataDate()

static void AppDynamics.Agent.Instrumentation.RemoveUserDataDate ( string  key)
inlinestatic

Removes the user data.

See also
SetUserData
Parameters
keyKey.

§ RemoveUserDataDouble()

static void AppDynamics.Agent.Instrumentation.RemoveUserDataDouble ( string  key)
inlinestatic

Removes the user data.

See also
SetUserData
Parameters
keyKey.

§ RemoveUserDataLong()

static void AppDynamics.Agent.Instrumentation.RemoveUserDataLong ( string  key)
inlinestatic

Removes the user data.

See also
SetUserData
Parameters
keyKey.

§ ReportError()

static void AppDynamics.Agent.Instrumentation.ReportError ( Exception  exception,
ErrorSeverityLevel  severity 
)
inlinestatic

Reports an error that was caught.

This can be called in catch blocks to report interesting errors that you want to track.

Parameters
exceptionThe exception to report.
severityThe severity level.

§ ReportMetricWithName()

static void AppDynamics.Agent.Instrumentation.ReportMetricWithName ( string  name,
long  value 
)
inlinestatic

Reports metric value for the given name.

The name can contain only alphanumeric characters and spaces.

Parameters
nameName of the metric key.
valueValue reported for the given key.
Exceptions
ExceptionThrown when parameter name is not in the right format.

§ RestartAgent()

static void AppDynamics.Agent.Instrumentation.RestartAgent ( )
inlinestatic

Restarts the sending of beacons to the collector.

Data will start flowing from the agent immediately.No change will occur if the shutdownAgent call and not been made.

summary> The current screenshotBlocked state. See blockScreenshots()

By default, the Xamarin agent has the screenshots unblocked. If screenshots are disabled through AgentConfiguration.ScreenshotsEnabled or through the controller UI, this flag will have no effect. The user is expected to manage any possible nesting issues that may occur if blocking and unblocking occur in different code paths.

Default false.

§ SetUserData()

static void AppDynamics.Agent.Instrumentation.SetUserData ( string  key,
string  value 
)
inlinestatic

Sets a key-value pair identifier that will be included in all snapshots.

The identifier can be used to add any data you wish.

  • The key must be unique across your application.
  • The key namespace is distinct for each user data type.
  • Re-using the same key overwrites the previous value.
  • Both the key and the value are limited to 2048 characters.

This information is not persisted across application runs. Once the application is destroyed, the user data is cleared.

Parameters
keyKey.
valueValue.

§ SetUserDataBoolean()

static void AppDynamics.Agent.Instrumentation.SetUserDataBoolean ( string  key,
bool  value 
)
inlinestatic

Sets a key-value pair identifier that will be included in all snapshots.

See also
SetUserData
Parameters
keyKey.
valueValue.

§ SetUserDataDate()

static void AppDynamics.Agent.Instrumentation.SetUserDataDate ( string  key,
DateTime  value 
)
inlinestatic

Sets a key-value pair identifier that will be included in all snapshots.

See also
SetUserData
Parameters
keyKey.
valueValue.

§ SetUserDataDouble()

static void AppDynamics.Agent.Instrumentation.SetUserDataDouble ( string  key,
double  value 
)
inlinestatic

Sets a key-value pair identifier that will be included in all snapshots.

See also
SetUserData
Parameters
keyKey.
valueValue.

§ SetUserDataLong()

static void AppDynamics.Agent.Instrumentation.SetUserDataLong ( string  key,
long  value 
)
inlinestatic

Sets a key-value pair identifier that will be included in all snapshots.

See also
SetUserData
Parameters
keyKey.
valueValue.

§ ShutdownAgent()

static void AppDynamics.Agent.Instrumentation.ShutdownAgent ( )
inlinestatic

Stops the sending of beacons to the collector

No data will come from this agent while shut down. All other activities of the agent continue, just the sending of data is disabled.

§ StartNextSession()

static void AppDynamics.Agent.Instrumentation.StartNextSession ( )
inlinestatic

Starts next session and ends the current session.

The session started using this API may be ended by inactivity timeout set in the Application Configuration, before the next call to this API.

This API makes some practical assumptions about session lengths among end users. Excessive use of this API will cause sessions to be throttled (as an indication, more than 10 calls per minute per agent is considered excessive and may, depending on other factors, cause throttling)

§ StartSessionFrame()

static ISessionFrame AppDynamics.Agent.Instrumentation.StartSessionFrame ( string  sessionFrameName)
inlinestatic

Starts a Session Frame.

Returns
A SessionFrame object is returned which should be retained for further operations.
Parameters
sessionFrameNameThe name of the session frame that will appear in the UI.

<since>50.1</since>

§ StartTimerWithName()

static void AppDynamics.Agent.Instrumentation.StartTimerWithName ( string  name)
inlinestatic

Starts a global timer with the given name.

The name can contain only alphanumeric characters and spaces.

Parameters
nameName of the timer.
Exceptions
ExceptionThrown when parameter name is not in the right format.

§ StopTimerWithName()

static void AppDynamics.Agent.Instrumentation.StopTimerWithName ( string  name)
inlinestatic

Stops a global timer with the given name and reports it.

The name can contain only alphanumeric characters and spaces.

Parameters
nameName of the timer.
Exceptions
ExceptionThrown when parameter name is not in the right format.

§ TakeScreenshot()

static void AppDynamics.Agent.Instrumentation.TakeScreenshot ( )
inlinestatic

Asynchronously takes a screenshot of the current Activity's window.

If screenshots are disabled through AgentConfiguration.ScreenshotsEnabled or through the controller UI, this method does nothing.

This will capture everything, including personal information, so you must be cautious of when to take the screenshot.

These screenshots will show up in the Sessions screen for this user.

The screenshots are taken on a background thread, compressed, and only non-redundant parts are uploaded, so it is safe to take many of these without impacting performance of your application.

§ UnblockScreenshots()

static void AppDynamics.Agent.Instrumentation.UnblockScreenshots ( )
inlinestatic

Unblocks screenshot capture if it is currently blocked. Otherwise, this has no effect.

If screenshots are disabled through AgentConfiguration.ScreenshotsEnabled or through the controller UI, this method has no effect.

If screenshots are set to manual mode in the controller UI, this method unblocks for manual mode only.

WARNING: This will unblock capture for the entire app.

The user is expected to manage any possible nesting issues that may occur if blocking and unblocking occur in different code paths.

See blockScreenshots

Member Data Documentation

§ enableAggregateExceptionReporting

bool AppDynamics.Agent.Instrumentation.enableAggregateExceptionReporting = false
static

Enables or disables the reporting of all exceptions as crashes.

By default, the Xamarin agent will not report aggregate exceptions as a crash report. This switch can be used to enable this feature.

Default false.


The documentation for this class was generated from the following files: