Esempio n. 1
0
 private void UpdateCounterConditional(PerformanceCounter c, CounterInvokeDirection expectedDirection)
 {
     if (c != null && (expectedDirection & _direction) == expectedDirection)
     {
         lock (c)
         {
             //reset name
             string ins = c.InstanceName;
             c.Increment();
             //also update overall insance!
             c.InstanceName = OverallInstance;
             c.Increment();
             c.InstanceName = ins;
         }
     }
 }
 private void UpdateCounterConditional(PerformanceCounter c, CounterInvokeDirection expectedDirection)
 {
     if (c != null && (expectedDirection & _direction) == expectedDirection)
     {
         lock (c)
         {
             //reset name
             string ins = c.InstanceName;
             c.Increment();
             //also update overall insance!
             c.InstanceName = OverallInstance;
             c.Increment();
             c.InstanceName = ins;
         }
     }
 }
Esempio n. 3
0
 public RatePerformanceCounterAttribute(string categoryName, string counterName, CounterInvokeDirection direction)
     : base(categoryName, counterName, PerformanceCounterType.RateOfCountsPerSecond32)
 {
     _direction = direction;
 }
 public RatePerformanceCounterAttribute(string categoryName, string counterName, CounterInvokeDirection direction)
     : base(categoryName, counterName, PerformanceCounterType.RateOfCountsPerSecond32)
 {
     _direction = direction;
 }