Exemple #1
0
 internal void Increment(long by, string metricName)
 {
     Interlocked.Increment(ref _occurance);
     if (metricName == null)
     {
         Interlocked.Add(ref _total, by);
     }
     else
     {
         NamedMetrics.AddOrUpdate(metricName, by, (i, t) => t + by);
     }
 }
Exemple #2
0
 internal void Increment(long by, string metricName)
 {
     if (metricName == "_Occurrence")
     {
         _occurance          = by;
         _occuranceOveridden = true;
     }
     else
     {
         if (!_occuranceOveridden)
         {
             Interlocked.Increment(ref _occurance);
         }
         if (metricName == null || metricName == "_Total")
         {
             Interlocked.Add(ref _total, by);
         }
         else
         {
             NamedMetrics.AddOrUpdate(metricName, by, (i, t) => t + by);
         }
     }
 }