etishor / Metrics.NET

The Metrics.NET library provides a way of instrumenting applications with custom metrics (timers, histograms, counters etc) that can be reported in various ways and can provide insights on what is happening inside a running application.
Apache License 2.0
647 stars 150 forks source link

Annotation #84

Open solmetricchris opened 9 years ago

solmetricchris commented 9 years ago

Is there anyway we could add metrics support to a system via Annotations, as per the original java code.

For example adding a Gauge via Annotation: https://github.com/dropwizard/metrics/blob/master/metrics-annotation/src/main/java/com/codahale/metrics/annotation/Gauge.java

etishor commented 9 years ago

Interesting idea. I'll investigate a few ways of doing this, but I'm not sure .net attributes provide enough functionality to implement this. It should be possible to implement on static methods, but I'm not sure if it is possible to "hook" into instance methods using attributes.