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

網(wǎng)站建設(shè)公司,為您提供網(wǎng)站建設(shè),網(wǎng)站制作,網(wǎng)頁(yè)設(shè)計(jì)及定制網(wǎng)站建設(shè)服務(wù),專注于企業(yè)網(wǎng)站制作,高端網(wǎng)頁(yè)制作,對(duì)PVC花箱等多個(gè)行業(yè)擁有豐富的網(wǎng)站建設(shè)經(jīng)驗(yàn)的網(wǎng)站建設(shè)公司。專業(yè)網(wǎng)站設(shè)計(jì),網(wǎng)站優(yōu)化推廣哪家好,專業(yè)seo優(yōu)化排名優(yōu)化,H5建站,響應(yīng)式網(wǎng)站。
您可以通過(guò) WCF 服務(wù)的 app.config 配置文件啟用WCF性能計(jì)數(shù)器,如下所示:
- < configuration>
- < system.serviceModel>
- < diagnostics performance
Counters="All" /> - < /system.serviceModel>
- < /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)參見(jiàn)“增加性能計(jì)數(shù)器的內(nèi)存大小”(可能為英文網(wǎng)頁(yè))一節(jié)。
還可以在代碼中啟用WCF性能計(jì)數(shù)器,如下所示:
- using System.Configuration;
- using System.ServiceModel.
Configuration;- using System.ServiceModel.
Diagnostics;- Configuration config =
ConfigurationManager.OpenExe
Configuration(- ConfigurationUserLevel.None);
- ServiceModelSectionGroup sg =
ServiceModelSectionGroup.
GetSectionGroup(config);- sg.Diagnostic.PerformanceCounters =
PerformanceCounterScope.All;- config.Save();
網(wǎng)頁(yè)標(biāo)題:詳細(xì)概論WCF性能計(jì)數(shù)器啟用問(wèn)題
文章來(lái)源:http://www.dlmjj.cn/article/djedjgd.html


咨詢
建站咨詢
