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
{{ message }}
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.
If we call addTaggedMetrics() with same name/tags, but different counter instances,
registry.addTaggedMetric will pass without error, however, the second call actually has no effect
Proof:
it('test behavior of wavefront metrics',()=>{constregistry: wfMetrics.Registry=newwfMetrics.Registry({})consttag1=newwfMetrics.Counter()registry.addTaggedMetric('test.metrics.counter.tagged',tag1,{tag: '1'})consttag2=newwfMetrics.Counter()registry.addTaggedMetric('test.metrics.counter.tagged',tag2,{tag: '1'})constrealCounter=registry.getMetric('test.metrics.counter.tagged-tags=[["tag","1"]]')expect(realCounter).eq(tag1)})
Rational: we have dynamically generated tags, and we don't know if a counter of same key/tags already exists unless we keep in-memory track of metrics we created, naturally, we call addTaggedMetrics() multiple times, and expect to having original counter.
solution:
make addTaggedMetrics() return existing metric if there is already one in registry,
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If we call addTaggedMetrics() with same name/tags, but different counter instances,
registry.addTaggedMetric will pass without error, however, the second call actually has no effect
Proof:
Rational: we have dynamically generated tags, and we don't know if a counter of same key/tags already exists unless we keep in-memory track of metrics we created, naturally, we call addTaggedMetrics() multiple times, and expect to having original counter.
solution:
make addTaggedMetrics() return existing metric if there is already one in registry,
The text was updated successfully, but these errors were encountered: