You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, consider a CompositeCounter made up of Counters from two registries where one registry may have filtered or otherwise produces a NoopMeter. Invoking CompositeCounter.count() may result in either 0 from the NoopMeter or some other value from the other Counter.
The problem appears to be in AbstractCompositeCounter.firstChild() as it doesn't filter out NoopMeters when delegating to the child. Alternatively a CompositeMeter could avoid placing any NoopMeters in its collection of child meters.
The text was updated successfully, but these errors were encountered:
When a CompositeMeterRegistry is used and one of its CompositeMeters
is polled (its value is fetched), the returned value can depend on
the order of the registries inside of the composite if the composite
contains a registry that has any NoopMeters.
Example: a CompositeMeterRegistry contains two registries, A and B.
We create a counter in the composite and increment it once.
After this both A and B contain one counter but lets say that
in A the counter is ignored so it will be noop.
When the count called on CompositeCounter, it can return
either 0 (if NoopCounter was used)
or 1 (if the non-noop counter was used).
In order to fix this, we can ignore the NoopMeters
when Meters are polled in a composite registry.
Closesmicrometer-metricsgh-1441
For example, consider a
CompositeCounter
made up ofCounter
s from two registries where one registry may have filtered or otherwise produces aNoopMeter
. InvokingCompositeCounter.count()
may result in either0
from theNoopMeter
or some other value from the otherCounter
.The problem appears to be in
AbstractCompositeCounter.firstChild()
as it doesn't filter outNoopMeters
when delegating to the child. Alternatively aCompositeMeter
could avoid placing anyNoopMeter
s in its collection of child meters.The text was updated successfully, but these errors were encountered: