SenseNet.ContentRepository.CounterManager.Initialize C# (CSharp) Method

Initialize() private method

private Initialize ( ) : void
return void
        private void Initialize()
        {
            _invalidCounters = new Dictionary<string, bool>();

            if (!RepositoryConfiguration.PerformanceCountersEnabled)
            {
                _counters = new SenseNetPerformanceCounter[0];
                return;
            }
            
            try
            {
                Category = CreateCategory();
                _counters = Category.GetCounters().Select(pc => new SenseNetPerformanceCounter(pc)).ToArray();
            }
            catch (Exception ex)
            {
                Logger.WriteException(new Exception("Error during performance counter initialization.", ex));
                _counters = new SenseNetPerformanceCounter[0];
            }
        }