On 2013-06-10 14:02, Benjamin Abadie wrote:
Hi, I'm looking for a way to reverse in and out position in port graphs. That is, display positive values for outbound, and negative ones for inbound. It can be interesting for a CDN, which mostly send its data to other ASes (booooo ! ;] )
I found a variable "$inverse" which *seems* to do what I want to do :
/opt/observium 0 # grep --exclude-dir=".svn" -n -r "$inverse" html/includes/graphs/generic_multi_data.inc.php:48: if ($inverse) { $in = 'out'; $out = 'in'; } else { $in = 'in'; $out = 'out'; } html/includes/graphs/generic_multi_bits.inc.php:39: if ($inverse) { $in = 'out'; $out = 'in'; } else { $in = 'in'; $out = 'out'; } html/includes/graphs/generic_data.inc.php:28:if ($inverse) { $in = 'out'; $out = 'in'; } else { $in = 'in'; $out = 'out'; } html/includes/graphs/multiport/bits_trio.inc.php:17: if (strstr($inverse, "a")) { $in = "OUT"; $out = "IN"; } else { $in = "IN"; $out = "OUT"; } html/includes/graphs/multiport/bits_trio.inc.php:37: if (strstr($inverse, "b")) { $in = "OUT"; $out = "IN"; } else { $in = "IN"; $out = "OUT"; } html/includes/graphs/multiport/bits_trio.inc.php:57: if (strstr($inverse, "c")) { $in = "OUT"; $out = "IN"; } else { $in = "IN"; $out = "OUT"; } html/includes/graphs/multiport/bits_duo.inc.php:45:if ($inverse) { $in = 'out'; $out = 'in'; } else { $in = 'in'; $out = 'out'; }
But setting it to true does not seem to change anything.
Am I completely mistaken ? If not, how should I use this ?
I know it's not an official feature (or I would have found a config option) but I'm just messing around a little with observium's code... ;)
I don't consider it a useful feature to swap in/out just for the sake of it.
The variables you see are for correcting the direction of a set of data which has been measured at the opposite end of the link as the other sets of data you're viewing.
I don't consider it useful to arbitrarily swap the direction of data, there is nothing to be gained from that.
If the data is leaving the port, it's leaving the port. Why would you want the graph to tell you it's entering the port?
adam.