Dotfuscator User's Guide
Feature Usage Attributes

Dotfuscator provides support for feature usage tracking via the Feature attribute. The developer may add a Feature attribute to any method which maps to the start, stop, or entirety of a feature. When Dotfuscator encounters a Feature attribute during its processing, and it is configured to “send analytics messages”, it adds code to the method to send a PreEmptive Analytics feature usage message. Feature attributes are not required at runtime; therefore, Dotfuscator strips them from the output application.

The Feature attribute has several arguments or properties.  Developers wishing to implement feature usage tracking with the PreEmptive Analytics Service will need to understand the use of the following properties:

Name

In order to make sense of feature-level analytics, features must be identified by a name. The Name argument is a string value which defines the name of the feature in question, and is required. This name need not follow any particular convention; but it should be descriptive and unique, except in cases where the feature attribute in question is one half of a start-stop pair in which case, the feature names should be identical.

Event Type

In order to identify what portion of the feature an attributed method implements, the FeatureEventType argument may be set. The FeatureEventType argument is an enumeration with the following values:

 

Enum Value Implication
FeatureEventTypes.Tick This method implements the entirety of the specified feature. (Default)
FeatureEventTypes.Start This method’s execution signifies the start of the specified feature. Code to send the message will be added to the start of the method.
FeatureEventTypes.Stop This method’s execution signifies the end of the specified feature. Code to send the message will be added to the end of the method.

The FeatureEventType argument is optional. If it is omitted, the default value (Tick) is assumed.

Sample Feature attribute usage for a method called as part of the Find feature:

Sample Feature Attribute
Copy Code
[Feature(
   "Find",
   FeatureEventType = FeatureEventTypes.Start
)]
private void BeginFind() { ... }

If a method’s logic fully encompasses a feature, you may place two feature attributes on the method: a start and a stop. Dotfuscator sends the start message when the method begins execution, and the stop message when the method completes.

Start and Stop Feature Attributes
Copy Code
[Feature(
   "Find",
   FeatureEventType = FeatureEventTypes.Start
)]
[Feature(
   "Find",
   FeatureEventType = FeatureEventTypes.Stop
)]
private void BeginFind() { ... }

 

 


© 2016 PreEmptive Solutions, LLC. All Rights Reserved.

www.preemptive.com