自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

詳細(xì)概論WCF性能計(jì)數(shù)器啟用問題

開發(fā) 開發(fā)工具
WCF性能計(jì)數(shù)器的啟用可以通過多種方法來實(shí)現(xiàn),在這篇文章中我們?yōu)榇蠹医榻B了一些實(shí)現(xiàn)的技巧,希望對(duì)又需要的朋友有所幫助。

WCF框架是一個(gè)比較復(fù)雜的開發(fā)工具,我們需要從實(shí)踐中不斷的去探索其中的功能應(yīng)用。其中WCF性能計(jì)數(shù)器是一個(gè)可以幫助我們衡量應(yīng)用程序性能的集合。#t#

您可以通過 WCF 服務(wù)的 app.config 配置文件啟用WCF性能計(jì)數(shù)器,如下所示:

  1. < configuration> 
  2. < system.serviceModel> 
  3. < diagnostics performance
    Counters
    ="All" /> 
  4. < /system.serviceModel> 
  5. < /configuration> 

可以將 performanceCounters 屬性設(shè)置為啟用特定類型的性能計(jì)數(shù)器。有效值為

All:?jiǎn)⒂盟蓄悇e計(jì)數(shù)器(ServiceModelService、ServiceModelEndpoint 和 ServiceModelOperation)。

ServiceOnly:僅啟用 ServiceModelService 類別計(jì)數(shù)器。

Off:禁用 ServiceModel* 性能計(jì)數(shù)器。這是默認(rèn)值。

如果要啟用所有WCF性能計(jì)數(shù)器,則可以將配置設(shè)置放置到 Machine.config 文件中。有關(guān)在計(jì)算機(jī)上為性能計(jì)數(shù)器配置足夠內(nèi)存的更多信息,請(qǐng)參見“增加性能計(jì)數(shù)器的內(nèi)存大小”(可能為英文網(wǎng)頁)一節(jié)。

還可以在代碼中啟用WCF性能計(jì)數(shù)器,如下所示:

  1. using System.Configuration;  
  2. using System.ServiceModel.
    Configuration;  
  3. using System.ServiceModel.
    Diagnostics;  
  4. Configuration config = 
    ConfigurationManager.OpenExe
    Configuration(  
  5. ConfigurationUserLevel.None);  
  6. ServiceModelSectionGroup sg = 
    ServiceModelSectionGroup.
    GetSectionGroup(config);  
  7. sg.Diagnostic.PerformanceCounters =
     
    PerformanceCounterScope.All;  
  8. config.Save(); 

 

責(zé)任編輯:曹凱 來源: 博客園
相關(guān)推薦

2009-11-06 16:59:26

WCF性能計(jì)數(shù)器

2010-02-22 16:34:17

WCF性能計(jì)數(shù)器

2009-12-22 13:25:58

WCF性能計(jì)數(shù)器內(nèi)存

2009-12-22 13:34:07

WCF性能計(jì)數(shù)器級(jí)別

2009-11-06 17:10:34

WCF服務(wù)性能計(jì)數(shù)器

2010-07-16 14:37:53

SQL Server

2009-10-29 11:47:15

ADO.NET計(jì)數(shù)器b

2023-08-08 08:01:22

微服務(wù)架構(gòu)服務(wù)

2010-11-30 13:43:07

SQL備份

2023-07-28 08:15:27

PC程序計(jì)數(shù)器

2009-04-15 10:33:35

SQL Server 性能計(jì)數(shù)器錯(cuò)誤

2011-04-06 10:03:08

Cacti遠(yuǎn)程監(jiān)控

2011-03-31 16:03:20

cacti性能計(jì)數(shù)器

2010-07-15 15:50:58

安裝SQL Serve

2022-04-08 07:22:15

分布式計(jì)數(shù)器系統(tǒng)設(shè)計(jì)

2009-06-11 16:27:18

科學(xué)型Java計(jì)數(shù)器

2009-11-25 15:07:39

PHP添加計(jì)數(shù)器

2009-12-07 15:37:00

WCF控件

2010-01-04 16:02:32

ADO.NET計(jì)數(shù)器

2009-12-01 15:01:07

PHP生成訪問計(jì)數(shù)器
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)