示例#1
0
        public STPInstancePerformanceCounters(string instance)
        {
            _isDisposed = false;
            _pcs        = new STPInstancePerformanceCounter[(int)STPPerformanceCounterType.LastCounter];

            // Call the STPPerformanceCounters.Instance so the static constructor will
            // intialize the STPPerformanceCounters singleton.
            STPPerformanceCounters.Instance.GetHashCode();

            for (int i = 0; i < _pcs.Length; i++)
            {
                if (instance != null)
                {
                    _pcs[i] = new STPInstancePerformanceCounter(
                        instance,
                        (STPPerformanceCounterType)i);
                }
                else
                {
                    _pcs[i] = _stpInstanceNullPerformanceCounter;
                }
            }
        }
示例#2
0
 // Methods
 static STPInstancePerformanceCounters()
 {
     _stpInstanceNullPerformanceCounter = new STPInstanceNullPerformanceCounter();
 }