diff options
Diffstat (limited to 'example')
-rwxr-xr-x | example/ivystat.pl | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/example/ivystat.pl b/example/ivystat.pl index 681bb01..933ad7c 100755 --- a/example/ivystat.pl +++ b/example/ivystat.pl @@ -234,7 +234,8 @@ sub writeLogs () # total : nb octets envoyés, nb mess envoyés, nb octets reçus, nb mess reçus # pour chaque agents en receptions : # nb octets envoyés, nb mess envoyés, - my (@sortedApp, $appf, $appn, $appt); + my (@sortedApp, $appf, $appn, $appt, $regx, $numRegx); + my %regxByNumOccur; # il faut que le filehandle LOG soit valide return unless fileno LOG; @@ -247,6 +248,19 @@ sub writeLogs () print "active:$nbActiveAgent, disconnected:$nbDeconnecteedAgent, " . "messages:$totalMess, bytes:$totalBytes\n\n"; + foreach $regx (keys %appByRegexp) { + $numRegx ++; + $regxByNumOccur{scalar (keys %{$appByRegexp{$regx}->[0]})}++; + } + + print "total of $numRegx regexps binded as following :\n"; + foreach (sort keys %regxByNumOccur) { + printf "%d regexp%s binded %d time%s\n", $regxByNumOccur{$_}, + $regxByNumOccur{$_} > 1 ? 's' : '', + $_, + $_ > 1 ? 's' : ''; + } + print "\n"; goto "EXIT_writeLogs" unless scalar (%appNameByhostAndPort); @sortedApp = reverse sort { |