Dynamics Plugins

Dynamics CRM Monitor CDS Plugins performance

Plugin performance in Dynamics CRM can be monitor and checked to find out the issues and trends like how many times plugins executes or failed.

Run-time information about plug-ins and custom workflow extensions is captured and store in the PluginTypeStatistic Entity. These records are populated within 30 minutes to one hour after the custom code executes. This entity provides the following data points:

AttributeDescription
AverageExecuteTimeInMillisecondsThe average execution time (in milliseconds) for the plug-in type. 
CrashContributionPercentThe plug-in type percentage contribution to crashes. 
CrashCountNumber of times the plug-in type has crashed. 
CrashPercentPercentage of crashes for the plug-in type. 
ExecuteCountNumber of times the plug-in type has been executed. 
FailureCount Number of times the plug-in type has failed. 
FailurePercentPercentage of failures for the plug-in type. 
PluginTypeIdNameUnique identifier of the user who last modified the plug-in type statistic. 
TerminateCpuContributionPercent The plug-in type percentage contribution to Worker process termination due to excessive CPU usage. 
TerminateHandlesContributionPercent The plug-in type percentage contribution to Worker process termination due to excessive handle usage. 
TerminateMemoryContributionPercentThe plug-in type percentage contribution to Worker process termination due to excessive memory usage. 
TerminateOtherContributionPercentThe plug-in type percentage contribution to Worker process termination due to unknown reasons. 

This data is also available for you to browse using the Power Platform Admin Center. Select Analytics > Common Data Service > Plug-ins.

Web API Query to check plugins Statistic

https://YourCrmOrg.api.crm.dynamics.com/api/data/v9.1/plugintypestatistics

Key things to consider in mind when writting plugin code

  1. The OutputParameters are not populated until after the database transaction, so they are only available for plug-ins registered in the PostOperation stage. If you want to change the values returned by the operation, you can modify them within the OutputParameters.
  2. For a plug-in registered for the PreOperation or PostOperation stages to access the shared variables from a plug-in registered for the PreValidation stage that executes on Create, Update, Delete, or by a RetrieveExchangeRateRequest, you must access the ParentContext.SharedVariables collection. For all other cases, IPluginExecutionContext.SharedVariables contains the collection.
  3. There are several deprecated specialized messages that perform update operations. In earlier versions it was required to use these messages, but now the same operations should be performed using IOrganizationService.Update or UpdateRequest class with IOrganizationService.Execute

BEHAVIOR OF SPECIALIZED UPDATE OPERATIONS
Deprecated message request Attribute(s) to update
AssignRequest <entity>.OwnerId
SetStateRequest <entity>.StateCode
<entity>.StatusCode
SetParentSystemUserRequest SystemUser.ParentSystemUserId
SetParentTeamRequest Team.BusinessUnitId
SetParentBusinessUnitRequest BusinessUnit.ParentBusinessUnitId
SetBusinessEquipmentRequest Equipment.BusinessUnitId
SetBusinessSystemUserRequest SystemUser.BusinessUnitId

Optimize assembly development

The assembly should include multiple plug-in classes (or types), but can be no larger than 16 MB. It is recommended to consolidate plug-ins and workflow assemblies into a single assembly as long as the size remains below 16 MB

Hope this helps!

Advertisement

One thought on “Dynamics CRM Monitor CDS Plugins performance

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s