예제 #1
0
        public StopWatchInternal(string tableName, string context, IReplicatedTableConfigurationWrapper replicatedTableConfigurationWrapper)
        {
            this._tableName = tableName;
            this._context   = context;

            if (replicatedTableConfigurationWrapper.IsIntrumentationEnabled())
            {
                ReplicatedTableLogger.LogVerbose("[Instrumentation] {0}:{1} started", _tableName, _context);

                _stopWatch = Stopwatch.StartNew();
            }
        }
예제 #2
0
        private void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                if (_stopWatch != null)
                {
                    _stopWatch.Stop();

                    ReplicatedTableLogger.LogVerbose("[Instrumentation] {0}:{1} took {2} ms", _tableName, _context, _stopWatch.ElapsedMilliseconds);
                }
            }

            _disposed = true;
        }