简体   繁体   中英

Using Performance Counters with Attributes

I'm looking for a way to simplify creating and using Performance Counters in our applications in order to run load tests and get the application specific information using the counters . It would be nice to do it using attributes. For example when a programmer puts an appropriate attribute on a method the method execution time is measured. So I'm looking for an attribute I can inherit that is activated by FW before and right after method call. Is there any attribute like this?

Thanks a lot, Dani

Edit: After some research I have found a PerformanceCounterCallHandlerAttribute from the EntLib. It seems to me that it is what I need but I'd like to know how exactly it works. I could not uderstand it from the documentaion I have found. Any help will be appreciated.

Check this . Not exactly what you are asking for but I believe same approach will work for you. It is all about handling before, after and on error events.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM