[backends] do not list excluded databases in output.
authorRuslan Kabalin <[email protected]>
Mon, 14 Mar 2011 22:18:36 +0000 (18:18 -0400)
committerGreg Sabino Mullane <[email protected]>
Mon, 14 Mar 2011 22:18:36 +0000 (18:18 -0400)
When used with --include or --exclude settings, listing all available
databases in perfomance output might be confusing. Thus, only those databases
that are taken into account for connectons number calculation are listed.

check_postgres.pl

index 83f10abe0d9a841dd77ae7b2603f045ecc30ba17..6efa00356214338ae72f90e610ced480908eba3e 100755 (executable)
@@ -2853,10 +2853,10 @@ ORDER BY datname
         elsif ($w3) {
             $nwarn = (int $w2*$limit/100)
         }
-        $db->{perf} .= sprintf ' %s=%s;%s;%s;0;%s',
-            perfname($r->{datname}), $r->{current}, $nwarn, $ncrit, $limit;
 
         if (! skip_item($r->{datname})) {
+            $db->{perf} .= sprintf ' %s=%s;%s;%s;0;%s',
+                perfname($r->{datname}), $r->{current}, $nwarn, $ncrit, $limit;
             $total += $r->{current};
         }
     }