From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: ipfire-scm@lists.ipfire.org Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 4cb6eb3f913af1325814d4f4a095d97fa08c5682 Date: Mon, 08 Mar 2021 18:05:37 +0000 Message-ID: <4DvR8d70WFz2xlq@people01.haj.ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8919578113033316195==" List-Id: --===============8919578113033316195== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 Date: Mon Mar 8 10:55:29 2021 +0000 core155: Ship graphs.pl =20 Signed-off-by: Michael Tremer commit 00db2d8343f3464bebfe439bad041ffe35b9f1ca Author: Leo-Andres Hofmann Date: Sun Mar 7 15:49:50 2021 +0100 QoS graphs: Add color mapping table =20 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. =20 Signed-off-by: Leo-Andres Hofmann Signed-off-by: Michael Tremer ----------------------------------------------------------------------- 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 { =20 my $ERROR=3D""; my $count=3D"1"; - my $color=3D"#000000"; + my %colorMap =3D (); # maps traffic classes to graph colors =20 my @command =3D ( @GRAPH_ARGS, @@ -1013,18 +1013,27 @@ sub updateqosgraph { @classes =3D ; close FILE; =20 - my $colorIndex =3D 0; foreach $classentry (sort @classes){ @classline =3D split( /\;/, $classentry ); + + # create class <-> color mapping + my $colorKey =3D uc $classline[8]; # upper case class name as key + if(! exists $colorMap{$colorKey}) { + # add missing color to table, use colors 11-25 + my $colorIndex =3D 11 + ((scalar keys %colorMap) % 15); + $colorMap{$colorKey} =3D "$color{\"color$colorIndex\"}"; + } + if ( $classline[0] eq $qossettings{'DEV'} ){ - my $colorIndex =3D 10 + $count % 15; - $color=3D"$color{\"color$colorIndex\"}"; push(@command, "DEF:$classline[1]=3D$mainsettings{'RRDLOG'}/class_$qosse= ttings{'CLASSPRFX'}-$classline[1]_$qossettings{'DEV'}.rrd:bytes:AVERAGE"); =20 + # get color to be used for this graph + my $graphColor =3D $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'} $class= line[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'} $clas= sline[1] -".sprintf("%15s",$classline[8])); } =20 push(@command, "GPRINT:$classline[1]:MAX:%8.1lf %sBps" diff --git a/config/rootfiles/core/155/filelists/files b/config/rootfiles/cor= e/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 --===============8919578113033316195==--