/// <summary> /// 初始化性能监视指针 /// </summary> protected void InitPerformanceCounters() { if (this.totalCounters == null) { this.totalCounters = new CachingPerformanceCounters("_Total_"); } if (this.counters == null) { this.counters = new CachingPerformanceCounters(this.GetType().Name); } }
/// <summary> /// 初始化性能监视指针 /// </summary> /// <param name="instanceName">本地性能监视器的指针</param> protected void InitPerformanceCounters(string instanceName) { #if NetFramework if (this.totalCounters == null) { this.totalCounters = new CachingPerformanceCounters("_Total_"); } if (this.counters == null) { instanceName.CheckStringIsNullOrEmpty("instanceName"); this.counters = new CachingPerformanceCounters(instanceName); } #endif }