11.07.2015 Views

y - Net Developer

y - Net Developer

y - Net Developer

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

amrameshreddy.blog.com196 CHAPTER 6 ■ MANAGING WCF SERVICESramrameshreddy.blog.com■Note Performance counters consume a lot of memory. Therefore, make sure you allocate substantialmemory when you run performance counters. It is good practice to add the line to the App.config file to increase the memory size. This willreplace the default size of 524,288 bytes.Enabling Built-in WCF Performance CountersEnabling WCF performance counters is a pretty straightforward process. The easiest way is toopen the configuration file in SvcConfigEditor.exe. In the Diagnostics window in the ServiceConfiguration Editor, you need to click only the Toggle Performance Counters link and savethe file to enable WCF built-in counters in your code. This will enter the following line in theApp.config file:You’ll now see some performance counters in action. Specifically, you will monitor theTradeServiceHost service activity using these counters. Here are the steps:1. Open App.config of TradeServiceHost using the Service Configuration Editor, andchange the diagnostic element to include performance counters. You can do this bychecking the Enable Performance Counter box.2. Build the WCFManagement solution. Run TradeServiceHost and the WCFSimpleClientmodule as the client. This will create the instances for the performance counters totrack against.3. Open Performance Monitor by selecting Start ➤ Control Panel ➤ Administrative Tools➤ Performance or by entering perfmon.exe at the Start ➤ Run command. You shouldsee Figure 6-8.4. Click the + button to add a performance counter.You will see the screen shown in Figure 6-9. You can clearly view the WCF-related countersunder the Processor section. They are prefixed by ServiceModel text.ramrameshreddyramrameshreddy

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!