Performance Timing Made Simple
March 28, 2017
<p>Recently I was working on an application that utilizes <a href="https://azure.microsoft.com/en-us/services/service-fabric/">Azure Service Fabric</a> and I was doing load testing before going live and I wasn’t getting the performance I was expecting. Since this application can only run under the service fabric runtime, profiling is a big challenge. Tools like <a href="http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/">ANTS Performance Profiler</a> or <a href="https://www.jetbrains.com/profiler/">dotTrace</a> can’t plug in since service fabric is hiding the application so I needed to turn to a regular C# StopWatch to track down the problem. I didn’t want to go into every method, create a stopwatch, start it, stop it, and log the value so I started looking for a better way to do it. I did a quick search and came across <a href="http://stackoverflow.com/a/969327/14275">this answer</a> from John Skeet who was accused of either not being John Skeet or voting for his own answer. I don’t know John Skeet but I doubt he needs to up-vote himself as he has mad (digital) street cred. Here is what John suggested:</p>