Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: adding values to a histogram appears to add to the bucket the value belongs to and all larger buckets #114

Open
tetrode opened this issue Mar 15, 2023 · 1 comment

Comments

@tetrode
Copy link

tetrode commented Mar 15, 2023

I created the following from the example code:

$h = rand(0, 10);
$histogram = $registry->getOrRegisterHistogram(
    'example',
    'the_histogram',
    'A histogram puts your observations in predefined buckets (+Inf is registered when no bucket found)',
    ['type'],
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9,]
);
$histogram->observe($h, ['blue']);

When I repeatedly call this code and $h is e.g. 6, the buckets for 6, 7, 8 and 9 are increased

Is this the expected behaviour?

@tetrode tetrode changed the title Question: adding values to a histogram appears to add to the bucket the value belongs to and all larget buckets Question: adding values to a histogram appears to add to the bucket the value belongs to and all larger buckets Mar 15, 2023
@MSid01
Copy link

MSid01 commented Jan 1, 2024

That's cumulative behaviour and... it is expected...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants