Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Add @Metric and deprecate @InjectMetric #58

Merged
merged 1 commit into from
Dec 15, 2013
Merged

Conversation

ryantenney
Copy link
Owner

New annotation @Metric will inject a metric, register the metric, or replace the metric in that field. @InjectMetric is also deprecated.

    @Metric
    Histogram histogram;

    @Metric
    Histogram uniformHistogram = new Histogram(new UniformReservoir());

In this example, field histogram will have an instance of Histogram injected (which defaults to using a BiasedReservoir), while field unbiasedHistogram will have its instance of Histogram (using a UniformReservoir) registered with the MetricRegistry (if multiple instances of this bean exist, subsequent beans will have the field unbiasedHistogram overwritten with the instance of Histogram which was previously registered with the MetricRegistry)

This resolves #38.

Conflicts:
	src/main/java/com/ryantenney/metrics/spring/MetricsBeanPostProcessorFactory.java
	src/main/java/com/ryantenney/metrics/spring/config/AnnotationDrivenBeanDefinitionParser.java
	src/main/java/com/ryantenney/metrics/spring/config/annotation/MetricsConfigurationSupport.java
ryantenney added a commit that referenced this pull request Dec 15, 2013
Add @Metric and deprecate @InjectMetric

Resolves #38
@ryantenney ryantenney merged commit dca92e0 into master Dec 15, 2013
@ryantenney ryantenney deleted the metric-annotation-2 branch December 15, 2013 22:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant