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

Easily save linear histograms #145

Closed
brendangregg opened this issue Aug 18, 2015 · 3 comments
Closed

Easily save linear histograms #145

brendangregg opened this issue Aug 18, 2015 · 3 comments

Comments

@brendangregg
Copy link
Member

A follow on from #144, this would allow a linear histogram to be easily saved. Eg:

BPF_HIST(myhist, linear, 0, 100, 10);
[...]
    myhist.increment(value);

Where the start is 0, end is 100, and a step of 10.

More exotic histograms can already be coded using BPF_TABLE directly. It's not too hard to do linear either, this is just for minor convenience.

@stefreak
Copy link

This would bring great value for everyone who tries to write a prometheus exporter based on BCC, because Prometheus expects histogram data to have a linear distribution for calculation of quantiles (see also here: https://prometheus.io/docs/prometheus/latest/querying/functions/#histogram_quantile() The histogram_quantile() function interpolates quantile values by assuming a linear distribution within a bucket.)

@hharnisc
Copy link

Hey @brendangregg was looking for a good first issue to start contributing and came across this one. Is this at all related to https://github.com/iovisor/bcc/blob/master/src/python/bcc/table.py#L346

@brendangregg
Copy link
Member Author

Looks like I did it in 39cece4 (so that I could add runqlen.py) but I forgot to close this ticket. Closing now!

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

No branches or pull requests

4 participants