Example #1
0
 public static void OnGlobalActivityEnded(ActivityScope globalActivityScope)
 {
     if (!ActivityCoverageReport.IsReportEnabled || globalActivityScope.ActivityType != ActivityType.Global)
     {
         return;
     }
     foreach (KeyValuePair <OperationKey, OperationStatistics> keyValuePair in globalActivityScope.Statistics)
     {
         OperationStatistics operationStatistics = null;
         if (ActivityCoverageReport.statistics.TryGetValue(keyValuePair.Key, out operationStatistics))
         {
             operationStatistics.Merge(keyValuePair.Value);
         }
         else
         {
             ActivityCoverageReport.statistics[keyValuePair.Key] = keyValuePair.Value;
         }
     }
     ActivityCoverageReport.currentActivityCycleCount++;
     if (ActivityCoverageReport.currentActivityCycleCount == ActivityCoverageReport.rollupActivityCycleCount)
     {
         ActivityCoverageReport.LogReport();
         ActivityCoverageReport.Clear();
     }
 }
Example #2
0
 public static void Configure(int globalActivityLifetimeMS, int rollupActivityCycleCount)
 {
     ActivityCoverageReport.rollupActivityCycleCount = rollupActivityCycleCount;
     ActivityCoverageReport.rollupTime = new TimeSpan(0, 0, 0, 0, rollupActivityCycleCount * globalActivityLifetimeMS);
     ActivityCoverageReport.Clear();
 }