Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Tue Sep 25, 2018 8:02 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Graphing powers of 2 with logarithmic scale
PostPosted: Mon Jul 02, 2018 6:50 pm 
Offline
Cacti User

Joined: Wed Mar 01, 2017 2:34 pm
Posts: 54
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?


Top
 Profile  
 
 Post subject: Re: Graphing powers of 2 with logarithmic scale
PostPosted: Wed Jul 11, 2018 7:46 am 
Offline
Cacti User

Joined: Wed Mar 01, 2017 2:34 pm
Posts: 54
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:
Attachment:
graph_image[2].png
graph_image[2].png [ 16.23 KiB | Viewed 68 times ]


Top
 Profile  
 
 Post subject: Re: Graphing powers of 2 with logarithmic scale
PostPosted: Wed Jul 11, 2018 9:16 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 1442
Sounds like you've made some progress though, that's good to know!

_________________
Cacti Resources:
Cacti Website
Cacti Issues
Cacti Releases

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Graphing powers of 2 with logarithmic scale
PostPosted: Wed Jul 11, 2018 12:23 pm 
Offline
Cacti User

Joined: Wed Mar 01, 2017 2:34 pm
Posts: 54
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. ;)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: ok1mgj and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group