Graphing powers of 2 with logarithmic scale

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
tertius
Cacti User
Posts: 82
Joined: Wed Mar 01, 2017 2:34 pm

Graphing powers of 2 with logarithmic scale

Post by tertius »

I would like to graph data that can take these 6 discrete values:
16, 64, 256, 1024, 4096, 16384

Unfortunately, the logarithmic scale of rrdtool is base 10, not base 2, so that scaling is not quite correct. I am also unable to get a sensible y-axis grid numbers this way (either SI-units or exponential, both is ugly).

If I compute the logarithm with base 2 from the values as cdef, I get the values 4, 6, 8, 10, 12, 14, which are nice to graph. This is how the graph should look like.
But I cannot get the y-axis description to 16, 64, 256 etc. Only to 4, 6, 8, etc.

Does anybody has a hint what I can do to graph the values as 4, 6, 8... but show 16, 64, 256... on the y-axis? Is there a feature in rrdtool that enables me to compute y-axis numbers instead of just formatting?
tertius
Cacti User
Posts: 82
Joined: Wed Mar 01, 2017 2:34 pm

Re: Graphing powers of 2 with logarithmic scale

Post by tertius »

No surprise nobody has a solution for it. Seems I'm asking things from rrdtool it doesn't contain.
My solution is to show the y-axis as bits and not as actual value. To get the bits as log2(value), I created a cdef with this definition: cdef=CURRENT_DATA_SOURCE,LOG,2,LOG,/

This is the resulting graph:
graph_image[2].png
graph_image[2].png (16.23 KiB) Viewed 454 times
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Graphing powers of 2 with logarithmic scale

Post by netniV »

Sounds like you've made some progress though, that's good to know!
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
tertius
Cacti User
Posts: 82
Joined: Wed Mar 01, 2017 2:34 pm

Re: Graphing powers of 2 with logarithmic scale

Post by tertius »

It's a very boring graph, actually. On my connection, it sticks to 64 all day, and if the line has some noise, it goes down to 16 for short amount of time, then back to 64. The corresponding downstream graph is even more boring: it sticks to 256 all day, and if it's not 256, it is empty and the line is disconnected. ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest