From 031f6e39137c29e9d74edb7e326b624782b6aaf8 Mon Sep 17 00:00:00 2001 From: Jordi Sanfeliu Date: Mon, 20 Jul 2020 09:59:40 +0200 Subject: [PATCH] added new 'separated' visualization mode in 'squid.pm' #217 --- lib/squid.pm | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/lib/squid.pm b/lib/squid.pm index 7ccbcd8..9f27679 100644 --- a/lib/squid.pm +++ b/lib/squid.pm @@ -1473,10 +1473,18 @@ sub squid_cgi { push(@tmpz, "LINE1:B_in#00EE00"); if(lc($config->{netstats_in_bps}) eq "y") { push(@CDEF, "CDEF:B_in=in,8,*"); - push(@CDEF, "CDEF:B_out=out,8,*"); + if(lc($config->{netstats_mode} || "") eq "separated") { + push(@CDEF, "CDEF:B_out=out,8,*,-1,*"); + } else { + push(@CDEF, "CDEF:B_out=out,8,*"); + } } else { push(@CDEF, "CDEF:B_in=in"); - push(@CDEF, "CDEF:B_out=out"); + if(lc($config->{netstats_mode} || "") eq "separated") { + push(@CDEF, "CDEF:B_out=out,-1,*"); + } else { + push(@CDEF, "CDEF:B_out=out"); + } } if(lc($config->{show_gaps}) eq "y") { push(@tmp, "AREA:wrongdata#$colors->{gap}:"); @@ -1572,10 +1580,18 @@ sub squid_cgi { push(@tmpz, "LINE1:B_in#00EE00"); if(lc($config->{netstats_in_bps}) eq "y") { push(@CDEF, "CDEF:B_in=in,8,*"); - push(@CDEF, "CDEF:B_out=out,8,*"); + if(lc($config->{netstats_mode} || "") eq "separated") { + push(@CDEF, "CDEF:B_out=out,8,*,-1,*"); + } else { + push(@CDEF, "CDEF:B_out=out,8,*"); + } } else { push(@CDEF, "CDEF:B_in=in"); - push(@CDEF, "CDEF:B_out=out"); + if(lc($config->{netstats_mode} || "") eq "separated") { + push(@CDEF, "CDEF:B_out=out,-1,*"); + } else { + push(@CDEF, "CDEF:B_out=out"); + } } if(lc($config->{show_gaps}) eq "y") { push(@tmp, "AREA:wrongdata#$colors->{gap}:");