diff options
author | Diego <diegolparra@gmail.com> | 2015-04-21 23:12:02 -0300 |
---|---|---|
committer | Diego <diegolparra@gmail.com> | 2015-04-21 23:12:02 -0300 |
commit | 7f1d880aa0672608503874d7edca0426c761afe1 (patch) | |
tree | 176b44e86f8671a92bb070dc00af3077fb6b0437 /kamon-annotation/src/main/scala | |
parent | 7e46b45a0f585764148a66b09041dbed2172ff80 (diff) | |
download | Kamon-7f1d880aa0672608503874d7edca0426c761afe1.tar.gz Kamon-7f1d880aa0672608503874d7edca0426c761afe1.tar.bz2 Kamon-7f1d880aa0672608503874d7edca0426c761afe1.zip |
= annotation: break histograms instrument into histograms and timeHistograms to avoid getStaticPart.Id collisions
Diffstat (limited to 'kamon-annotation/src/main/scala')
3 files changed, 7 insertions, 4 deletions
diff --git a/kamon-annotation/src/main/scala/kamon/annotation/instrumentation/AnnotationInstrumentation.scala b/kamon-annotation/src/main/scala/kamon/annotation/instrumentation/AnnotationInstrumentation.scala index 381aeb72..bfeac62a 100644 --- a/kamon-annotation/src/main/scala/kamon/annotation/instrumentation/AnnotationInstrumentation.scala +++ b/kamon-annotation/src/main/scala/kamon/annotation/instrumentation/AnnotationInstrumentation.scala @@ -35,6 +35,7 @@ class AnnotationInstrumentation extends BaseAnnotationInstrumentation { obj.counters = new AtomicReferenceArray[Counter](size) obj.minMaxCounters = new AtomicReferenceArray[MinMaxCounter](size) obj.histograms = new AtomicReferenceArray[instrument.Histogram](size) + obj.timeHistograms = new AtomicReferenceArray[instrument.Histogram](size) } @Around("execution(@kamon.annotation.Trace !static * (@kamon.annotation.EnableKamon AnnotationInstruments+).*(..)) && this(obj)") @@ -53,8 +54,8 @@ class AnnotationInstrumentation extends BaseAnnotationInstrumentation { @Around("execution(@kamon.annotation.Time !static * (@kamon.annotation.EnableKamon AnnotationInstruments+).*(..)) && this(obj)") def time(pjp: ProceedingJoinPoint, obj: AnnotationInstruments): AnyRef = { - var histogram = obj.histograms.get(pjp.getStaticPart.getId) - if (histogram == null) histogram = registerTime(pjp.getStaticPart, obj.histograms, StringEvaluator(obj), TagsEvaluator(obj)) + var histogram = obj.timeHistograms.get(pjp.getStaticPart.getId) + if (histogram == null) histogram = registerTime(pjp.getStaticPart, obj.timeHistograms, StringEvaluator(obj), TagsEvaluator(obj)) processTime(histogram, pjp) } diff --git a/kamon-annotation/src/main/scala/kamon/annotation/instrumentation/BaseAnnotationInstrumentation.scala b/kamon-annotation/src/main/scala/kamon/annotation/instrumentation/BaseAnnotationInstrumentation.scala index 2074e237..6e590538 100644 --- a/kamon-annotation/src/main/scala/kamon/annotation/instrumentation/BaseAnnotationInstrumentation.scala +++ b/kamon-annotation/src/main/scala/kamon/annotation/instrumentation/BaseAnnotationInstrumentation.scala @@ -146,6 +146,7 @@ trait AnnotationInstruments { var traces: AtomicReferenceArray[TraceContextInfo] = _ var segments: AtomicReferenceArray[SegmentInfo] = _ var histograms: AtomicReferenceArray[instrument.Histogram] = _ + var timeHistograms: AtomicReferenceArray[instrument.Histogram] = _ var counters: AtomicReferenceArray[Counter] = _ var minMaxCounters: AtomicReferenceArray[MinMaxCounter] = _ } diff --git a/kamon-annotation/src/main/scala/kamon/annotation/instrumentation/StaticAnnotationInstrumentation.scala b/kamon-annotation/src/main/scala/kamon/annotation/instrumentation/StaticAnnotationInstrumentation.scala index 24ce75fd..2320cc09 100644 --- a/kamon-annotation/src/main/scala/kamon/annotation/instrumentation/StaticAnnotationInstrumentation.scala +++ b/kamon-annotation/src/main/scala/kamon/annotation/instrumentation/StaticAnnotationInstrumentation.scala @@ -36,6 +36,7 @@ class StaticAnnotationInstrumentation extends BaseAnnotationInstrumentation with counters = new AtomicReferenceArray[Counter](size) minMaxCounters = new AtomicReferenceArray[MinMaxCounter](size) histograms = new AtomicReferenceArray[instrument.Histogram](size) + timeHistograms = new AtomicReferenceArray[instrument.Histogram](size) } @Around("execution(@kamon.annotation.Trace static * (@kamon.annotation.EnableKamon *).*(..))") @@ -60,10 +61,10 @@ class StaticAnnotationInstrumentation extends BaseAnnotationInstrumentation with @Around("execution(@kamon.annotation.Time static * (@kamon.annotation.EnableKamon *).*(..))") def time(pjp: ProceedingJoinPoint): AnyRef = { - var histogram = histograms.get(pjp.getStaticPart.getId) + var histogram = timeHistograms.get(pjp.getStaticPart.getId) if (histogram == null) { val clazz = declaringType(pjp.getSignature) - histogram = registerTime(pjp.getStaticPart, histograms, StringEvaluator(clazz), TagsEvaluator(clazz)) + histogram = registerTime(pjp.getStaticPart, timeHistograms, StringEvaluator(clazz), TagsEvaluator(clazz)) } processTime(histogram, pjp) } |