public static void AddDeliveryThreadSample(string mdbGuid, long sample) { StoreDriverDatabasePerfCounters.InstanceEntry instanceEntry = StoreDriverDatabasePerfCounters.GetInstanceEntry(mdbGuid); if (instanceEntry != null) { instanceEntry.DeliveryThreadsCounter.AddValue(sample); lock (MSExchangeStoreDriverDatabase.TotalInstance.CurrentDeliveryThreadsPerMdb) { instanceEntry.PerfCounterInstance.CurrentDeliveryThreadsPerMdb.RawValue = instanceEntry.DeliveryThreadsCounter.CalculateAverage(); } } }
public static void IncrementDeliveryAttempt(string mdbGuid, bool calculateOnly = false) { StoreDriverDatabasePerfCounters.InstanceEntry instanceEntry = StoreDriverDatabasePerfCounters.GetInstanceEntry(mdbGuid); if (instanceEntry != null) { if (!calculateOnly) { instanceEntry.DeliveryAttemptsCounter.AddValue(1L); } lock (MSExchangeStoreDriverDatabase.TotalInstance.DeliveryAttempts) { instanceEntry.PerfCounterInstance.DeliveryAttempts.RawValue = instanceEntry.DeliveryAttemptsCounter.CalculateAverage(); } } }