I am intercepting wcf calls of services I host in my application in order to display data about the service (how many calls each method handled, log the methods parameters etc`). In addition to that, I want to measure the execution time of each method.
I am already wrapping the instance with Castle interceptor, and I use StopWatch
to measure the sync methods.
However, I can not use stopwatch on async method because I have 2 different methods (for beginInvoke
and EndInvoke
, I intercept the WCF invoker).
How can I measure the execution time, or at least relate the invocations of Begin and End?
Thanks