Click or drag to resize
IAnalyticsMonitorTrackFeatureStop Method
Register the end of a feature usage stared by TrackFeatureStart(String) with a similar featureName.

Namespace: EQATEC.Analytics.Monitor
Assembly: EQATEC.Analytics.Monitor (in EQATEC.Analytics.Monitor.dll) Version: 3.2.1.0 (3.2.1)
Syntax
TimeSpan TrackFeatureStop(
	string featureName
)

Parameters

featureName
Type: SystemString
The name of the feature. If it is null or empty the request is ignored.

Return Value

Type: TimeSpan
The total time tracked for this feature or TimeSpan.Zero if timing was not tracked
Remarks
Calling this method with a featureName that does not match an already started feature timing has no effect. All features timings are implicitly stopped by calling Stop.
Examples
The following shows an example of how you can track feature time in your application
class SomeClass
{   
  private IAnalyticsMonitor m_monitor;
  public SomeClass(IAnalyticsMonitor monitor)
  {
    m_monitor = monitor;
  }
  public void Process()
  {
    try 
    {
       m_monitor.TrackFeatureStart("SomeClass.Process");

       //some process logic to time

       TimeSpan timeSpent = m_monitor.TrackFeatureStop("SomeClass.Process");
    }
    catch(Exception exc)
    {
      m_monitor.TrackFeatureCancel("SomeClass.Process");
      throw;
    }
  } 
}
See Also