rrdtool-1.x
rrdtool-1.x copied to clipboard
--logarithmic and --base don't work together
This issue was originally reported at https://bugs.debian.org/558402
Hi,
Using the combination of --logarithmic with --base 1024 does not work like expected. The --base 1024 part doesn't have any effect.
I'm making graphs of things like disk usage, and the disk usage grows exponentionaly giving, so giving a more or less straight line on a logarithmic scale.
I add the values in bytes, so that I get a proper unit on the graph, but I'm used to work with GiB (base 1024) but it's showing it to me with base 1000 on the graph.
Kurt
That was back in 2009, but the issue is still there as far as I can tell.
I guess all it would take initially would be to replace the
log10(value) with log(value)/log(base/100)
(or is my math too far gone already)
I am not sure though if 10.24 based logarithmic presentation is will defined
maybe it would be better to show an error message when someone tries the combination ?
Your math looks ok.
An error message would be better than silently discarding the option. But it is legitimate to combine both options, in my opinion.
Today nirgal wrote:
I've been thinking about a patch. Obviously we don't want to compute log(base/100) on each pixel. What about adding a field in struct image_desc_t, maybe after "long base", that would contain a precomputed "1/log(base/100)". That way, we just have to multiply by that value. That structure is private, right?
I had a quick look at the code and
image_desc_t im
seems available everywhere we need the base, so doesn't look too hard.
yes using the image_desc for this is fine