I'm looking to publish custom performance counters for certain important function calls in the system. I'd like to continously monitor these performance counters in a production environment.
Is there a way for me to mark certain functions with a custom attribute that could measure the time it took to execute given function? I'd like to avoid injecting custom code and thus polluting business-related functions with monitoring code.
How can a code from an attribute track the time it took for function to execute?
Please do not suggest use of a Profiler. I'm not looking to debug or benchmark performance. But simply wanting to track it in on a production 24/7 basis.