I recently found this article:
http://coderjournal.com/2010/10/timing-the-execution-time-of-your-mvc-actions/
Which shows a nice little attribute that you can add to your Controller classes, which creates a stopwatch and sticks an X-Runtime header into the result.
I’ve been trying to add something similar to my WCF Rest service, but have been unable to figure it out so far. Any suggestions on how I could go about implementing something similar on my webservice?
This is a perfect place for aspects. Check out post sharp.
You can then create an aspect kind of like:
And all you have to do is tag your methods like this:
Advanced post sharp features require a license but simple ones like method boundary aspects are free.
While this doesn’t test any network boundaries for your wcf service it will test your service implementation time.
If you really wanted to you could create some custom behaviors and inject that into your WCF chain to test timing, but the likelihood of bottlenecks at that phase is pretty unlikely. What’s more likely is you are sending a lot of data so things are slow, or things in your implementation are slow, all of which can be tested server side or client side independently.