Closed fizmax closed 10 years ago
That's a great idea. Let's have a default MetricRegistry
called metrics-registry
created by default and available via the SharedMetricRegistries
util class.
Having the registry specified as an attribute of the Metrics
annotation sounds a good idea as well. The only limitation that I see for that approach is that the Metrics
annotation only targets types for now so that all the methods within the same class will have to be instrumented within the same registry. However, that could be addressed by allowing the Metrics
annotation to target methods as well so that would override the registry per method.
How about implementing some default MetricRegistry, so that the programmer was not forced to place @Registry("") annotation everywhere along with @Metrics? Only in case if he/she wants separate registries. Or even combine these two annotations and specify registry name in @Metrics annotation, like @Metrics(registry = ""), also with a default value :)