Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Performance Counters on Web Service Operations

I have a WCF service hosted in a Windows Service communicating with a winform client over netTCP.

The WCF service was hosted in IIS a long time ago and at this point I could see every operation of the WCF service in the performance counter monitor(performanceCounters="All"). This made it easy to see what operations was most used.

I need these performance counters again but this time I can´t find them in performance monitor even while the performanceCounters is set to "All"?

What do I need to do to bring them back?

The WCF service demands login to use its operations but the login is done by me manually, this means that the user first calls the Login operation with username and password and if its not correct data, then a securityException will be thrown. So nothing advanced.

like image 281
Banshee Avatar asked Dec 05 '14 08:12

Banshee


1 Answers

WCF is full of great monitoring tools and extensibility endpoints that you can either utilize or hook into your own solution.

You can definitely got some level of instrumentation out of the box, http://msdn.microsoft.com/en-us/library/ms735098(v=vs.110).aspx this article explains the simple app.config change youll need to publish those metrics.

If you want more detailed information (or simply something that isnt yet provided for you) you can indeed create a IOperationInvoker or an IParamterInspector that is called right before the method is called (in your implemenation) and right after it completes. Ive used this before to add context information on a thread before the method is called, to check the caller is passing parameters that they are authorized to use and to gauge the call performance by simply timestamping before and after the call. Check out http://msdn.microsoft.com/en-us/library/System.ServiceModel.Dispatcher(v=vs.110).aspx for a list of extensibility points in the WCF stack. Good luck

like image 68
ewassef Avatar answered Oct 21 '22 12:10

ewassef