Exemple #1
0
 public void OnInvoke(CommandEventArgs e)
 {
     foreach (IPerformanceCounter c in PerformanceCounterRegistry.Fetch(e.CommandType))
     {
         var counter = (IPerformanceCounter)c;
         switch (counter.CounterType)
         {
         case PerformanceCounterType.AverageOperationTime:
             ((AverageOperationTimePerformanceCounter)counter).Stopwatch.Start();
             break;
         }
     }
 }
Exemple #2
0
 public void OnInvokeException(CommandExceptionEventArgs e)
 {
     foreach (IPerformanceCounter c in PerformanceCounterRegistry.Fetch(e.CommandType))
     {
         var counter = (IPerformanceCounter)c;
         switch (counter.CounterType)
         {
         case PerformanceCounterType.AverageOperationTime:
         case PerformanceCounterType.OperationSuccessRatio:
         case PerformanceCounterType.OperationsPerSecond:
             counter.Increment();
             break;
         }
     }
 }