question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The counter is broken

See original GitHub issue
        // noLabels = Counter.build().name("nolabels").help("help").register(registry);
	long counter = 9200000000000000l;
	noLabels.inc(counter);
	for (int i = 0; i < 30; i++) {
		noLabels.inc();
		System.out.println(String.format("%32.0f", noLabels.get()));
	};

Expected output:

                9200000000000001
                9200000000000002
                9200000000000003

Actual output:

                9200000000000000
                9200000000000000
                9200000000000000
                9200000000000000
                9200000000000000
                9200000000000000

I think AtomicLong would be much better suited for a counter.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
brian-brazilcommented, Sep 25, 2017

Prometheus uses float64s and there’s no plans to change this.

The case you suggest is extremely unlikely in practice.

0reactions
voronaamcommented, Sep 25, 2017

I would not call that “engineered”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Counter is broken in ultimate. : r/smashbros - Reddit
Counter is broken in ultimate. So im playing Puff vs some random Roy. I threw out Sing (up special) in neutral ...
Read more >
Broken monster counter, what does this do ... - Kongregate
So since i cant find info on this il ask here, what does this do? do the extra monster counters add more gold...
Read more >
what to do about a broken countertop? - Fine Homebuilding
I would insist on replacement. Sooner or later, water will get into the cracks and may damage the cabinetry. And, unless the countertop...
Read more >
Algorithm counter is broken with journal style file - TeX
The algorithm counter is reset at each section. That's because the gSCS2e class defines an algorithm environment. This uses a counter with ...
Read more >
COUNTER BROKEN - Spotify
Listen to COUNTER BROKEN on Spotify. Artist · 437 monthly listeners.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found