Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

InMemoryMetricsFactory.createGauge considers amount as delta #459

Closed
mdouaihy opened this issue Jun 20, 2018 · 3 comments
Closed

InMemoryMetricsFactory.createGauge considers amount as delta #459

mdouaihy opened this issue Jun 20, 2018 · 3 comments

Comments

@mdouaihy
Copy link
Contributor

Hello,

I am using the Java Jaeger client in my project. I stumbled upon InMemoryMetricsFactory and noticed a bug in the createGauge method.

In fact createGauge considers the amount as a delta whereas it's an absolute amount.

Current Behavior

return new Gauge() {
      @Override
      public void update(long amount) {
        value.addAndGet(amount);
      }
    };

Suggested Behavior

return new Gauge() {
      @Override
      public void update(long amount) {
        value.getAndSet(amount);
      }
    };
@jpkrohling
Copy link
Collaborator

Would you like to contribute a fix? If you need help in submitting your first contribution, let me know.

@mdouaihy
Copy link
Contributor Author

I will be with pleasure to provide a first fix PR soon.

mdouaihy added a commit to mdouaihy/jaeger-client-java that referenced this issue Jun 21, 2018
In InMemoryMetricsFactory, upon updating the gauge, the argument
should be considered as the new value and not a variation to
the previous one.

Signed-off-by: Mehrez Douaihy <mehrez.douaihy@gmail.com>
@mdouaihy
Copy link
Contributor Author

Pull request #463 was added for that purpose.

yurishkuro pushed a commit that referenced this issue Jun 21, 2018
In InMemoryMetricsFactory, upon updating the gauge, the argument
should be considered as the new value and not a variation to
the previous one. Resolves #459.

Signed-off-by: Mehrez Douaihy <mehrez.douaihy@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants