Example #1
0
 /// <summary>
 /// Timestample and updates the counter for Cache avg. and max. per mill-second time of
 /// any operation operation.
 /// </summary>
 public void MsecPerCacheOperationEndSample()
 {
     if (_pcMsecPerCacheOperation != null)
     {
         lock (_pcMsecPerCacheOperation)
         {
             _nsMsecPerCacheOperation.Stop();
             _pcMsecPerCacheOperation.IncrementBy((long)_nsMsecPerCacheOperation.Duration(1));
             _pcMsecPerCacheOperationBase.Increment();
         }
     }
 }
Example #2
0
        /// <summary>
        /// Timestample and updates the counter for Cache avg. and max. per mill-second time of
        /// any operation operation.
        /// </summary>
        public void MsecPerCacheOperationEndSample()
        {
            if (_pcMsecPerCacheOperation != null)
            {
                lock (_pcMsecPerCacheOperation)
                {
                    _nsMsecPerCacheOperation.Stop();
                    long timeSpent = (long)_nsMsecPerCacheOperation.Duration(1);
                    if (timeSpent < 0)
                    {
                        timeSpent = timeSpent * -1;
                    }

                    _pcMsecPerCacheOperation.IncrementBy((long)timeSpent);
                    _pcMsecPerCacheOperationBase.Increment();
                }
            }
        }