Calculating maximum value

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

Moderators: Developers, Moderators

Post Reply
User avatar
Cylindric
Cacti User
Posts: 54
Joined: Mon Jul 16, 2007 9:32 am

Calculating maximum value

Post by Cylindric »

I'm trying to get two numerically-unrelated lines on one graph, to correlate a server's TPS with another metric. The problem is that one can be in the range 0-50k or even more, and the other is in the range of about 0-5.

To get these showing in a comparable way on one graph I've tried using CURRENT_DS_MAXIMUM_VALUE, but that seems to be the max value as defined in the DS, and not the max value currently "on screen", so I just get 'U'.

For some charts it works to use Logarithmic scaling, as that can visually expand the low items and still show the high items, but doesn't always look right, as the high-value line get's compressed.

Basically what I need is something like

a, MAX_VISIBLE_DS_VALUE, /, 100, *
and
b, MAX_VISIBLE_DS_VALUE, /, 100, *

Am I missing some obvious way of scaling a DS to 100%, when I don't know the actual max? In this example, TPS can be from 0 to 50k or even more, so the DS is setup as max "U".
Attachments
graph_2.png
graph_2.png (11.73 KiB) Viewed 675 times
graph_1.png
graph_1.png (11.87 KiB) Viewed 675 times
Server: Windows Server 2008 R2 x64 (running on a VM, 4Gb RAM)
Cacti: 0.8.8a (using cmd, 270 datasources in 145s)
MySQL: 5.5.16, Apache: 2.2.21, PHP: 5.3.16
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Calculating maximum value

Post by gandalf »

So, what exactly do you want to achieve? Do you want to change automatic scaling? Do you want to change y-axis to a percentage of something?
R.
User avatar
Cylindric
Cacti User
Posts: 54
Joined: Mon Jul 16, 2007 9:32 am

Re: Calculating maximum value

Post by Cylindric »

I'm not sure how else to explain it. I can auto-scale the Y-axis already, Ideally I'd like to have a CDEF to scale a LINE1 to a range, but to do that I need to know the highest value in the current displayed date range.

For example, if you take only the left half of the data I attached above, I would
1. take the green values, divide by 30 and multiply by 100 to get a percentage
2. take the red values, divide by 5k and multiply by 100 to get a percentage
3. display them both on one graph.

But if you take only the right half of the data I would
1. take the green values, divide by 8 and multiply by 100 to get a percentage
2. take the red values, divide by 2k and multiply by 100 to get a percentage
3. display them both on one graph.


The bit of information I'm missing in my CDEF is the maximum value of a DS for a given date-range (the current graph).

Basically, I want to normalise two arbitrary DS so they can be compared. "Oh look, IIS connections is up, and so are SQL transactions/sec". I can't do that at the moment, because the green line dissapears if plotted on a 0-5k graph, and the red line flattens out if I use a log graph. Also, I can't arbitrarily "divide by 5k" for example, because the values vary so wildly.
Server: Windows Server 2008 R2 x64 (running on a VM, 4Gb RAM)
Cacti: 0.8.8a (using cmd, 270 datasources in 145s)
MySQL: 5.5.16, Apache: 2.2.21, PHP: 5.3.16
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Calculating maximum value

Post by gandalf »

This looks like a VDEF approach (this may give you a max value of a ds) and, perhaps, a COMPUTE as well (to store computed data in an rrd file, using data of some ds' within that rrd but without dealing with CACTI ds naming conventions).
Both will be available with 089. You may have a try on current alpha code to verify
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest