* [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 4cb6eb3f913af1325814d4f4a095d97fa08c5682
@ 2021-03-08 18:05 Michael Tremer
0 siblings, 0 replies; only message in thread
From: Michael Tremer @ 2021-03-08 18:05 UTC (permalink / raw)
To: ipfire-scm
[-- Attachment #1: Type: text/plain, Size: 4076 bytes --]
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".
The branch, next has been updated
via 4cb6eb3f913af1325814d4f4a095d97fa08c5682 (commit)
via 00db2d8343f3464bebfe439bad041ffe35b9f1ca (commit)
from ea6fa0bcef42d3f33fef845c17af8148b6846084 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 4cb6eb3f913af1325814d4f4a095d97fa08c5682
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Mon Mar 8 10:55:29 2021 +0000
core155: Ship graphs.pl
Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>
commit 00db2d8343f3464bebfe439bad041ffe35b9f1ca
Author: Leo-Andres Hofmann <hofmann(a)leo-andres.de>
Date: Sun Mar 7 15:49:50 2021 +0100
QoS graphs: Add color mapping table
Use the traffic class description field to identify similar classes.
This ensures that a class used in both the up- and down-link is
printed with matching colors in both graphs.
Signed-off-by: Leo-Andres Hofmann <hofmann(a)leo-andres.de>
Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>
-----------------------------------------------------------------------
Summary of changes:
config/cfgroot/graphs.pl | 21 +++++++++++++++------
config/rootfiles/core/155/filelists/files | 1 +
2 files changed, 16 insertions(+), 6 deletions(-)
Difference in files:
diff --git a/config/cfgroot/graphs.pl b/config/cfgroot/graphs.pl
index aced99125..e4c3613fb 100644
--- a/config/cfgroot/graphs.pl
+++ b/config/cfgroot/graphs.pl
@@ -989,7 +989,7 @@ sub updateqosgraph {
my $ERROR="";
my $count="1";
- my $color="#000000";
+ my %colorMap = (); # maps traffic classes to graph colors
my @command = (
@GRAPH_ARGS,
@@ -1013,18 +1013,27 @@ sub updateqosgraph {
@classes = <FILE>;
close FILE;
- my $colorIndex = 0;
foreach $classentry (sort @classes){
@classline = split( /\;/, $classentry );
+
+ # create class <-> color mapping
+ my $colorKey = uc $classline[8]; # upper case class name as key
+ if(! exists $colorMap{$colorKey}) {
+ # add missing color to table, use colors 11-25
+ my $colorIndex = 11 + ((scalar keys %colorMap) % 15);
+ $colorMap{$colorKey} = "$color{\"color$colorIndex\"}";
+ }
+
if ( $classline[0] eq $qossettings{'DEV'} ){
- my $colorIndex = 10 + $count % 15;
- $color="$color{\"color$colorIndex\"}";
push(@command, "DEF:$classline[1]=$mainsettings{'RRDLOG'}/class_$qossettings{'CLASSPRFX'}-$classline[1]_$qossettings{'DEV'}.rrd:bytes:AVERAGE");
+ # get color to be used for this graph
+ my $graphColor = $colorMap{$colorKey};
+
if ($count eq "1") {
- push(@command, "AREA:$classline[1]$color:$Lang::tr{'Class'} $classline[1] -".sprintf("%15s",$classline[8]));
+ push(@command, "AREA:$classline[1]$graphColor:$Lang::tr{'Class'} $classline[1] -".sprintf("%15s",$classline[8]));
} else {
- push(@command, "STACK:$classline[1]$color:$Lang::tr{'Class'} $classline[1] -".sprintf("%15s",$classline[8]));
+ push(@command, "STACK:$classline[1]$graphColor:$Lang::tr{'Class'} $classline[1] -".sprintf("%15s",$classline[8]));
}
push(@command, "GPRINT:$classline[1]:MAX:%8.1lf %sBps"
diff --git a/config/rootfiles/core/155/filelists/files b/config/rootfiles/core/155/filelists/files
index c209e5485..e8cb51f61 100644
--- a/config/rootfiles/core/155/filelists/files
+++ b/config/rootfiles/core/155/filelists/files
@@ -4,3 +4,4 @@ srv/web/ipfire/cgi-bin/wirelessclient.cgi
srv/web/ipfire/cgi-bin/zoneconf.cgi
srv/web/ipfire/html/include/zoneconf.js
usr/local/bin/filesystem-cleanup
+var/ipfire/graphs.pl
hooks/post-receive
--
IPFire 2.x development tree
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-03-08 18:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-08 18:05 [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 4cb6eb3f913af1325814d4f4a095d97fa08c5682 Michael Tremer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox