]> git.proxmox.com Git - pmg-api.git/commitdiff
total_mail_stat: return bytes_in/bytes_out in bytes (instead of MBytes)
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 29 Nov 2017 10:35:48 +0000 (11:35 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 29 Nov 2017 10:45:45 +0000 (11:45 +0100)
PMG/CLI/pmgreport.pm
PMG/Statistic.pm

index c41de8ca98337e4b445fb5b127b19003fb4a92b8..12d7eca30a96ac378b837c934fdd4f6df89ac571 100644 (file)
@@ -145,7 +145,7 @@ my $get_incoming_table_data = sub {
 
     push @$data, {
        text => 'Mail Traffic',
-       value => sprintf ("%.3f MByte", $totals->{traffic_in}),
+       value => sprintf ("%.3f MByte", $totals->{traffic_in}/(1024*1024)),
     };
 
     return $data;
@@ -170,7 +170,7 @@ my $get_outgoing_table_data = sub {
 
     push @$data, {
        text => 'Mail Traffic',
-       value => sprintf ("%.3f MByte", $totals->{traffic_out}),
+       value => sprintf ("%.3f MByte", $totals->{bytes_out}/(1024*1024)),
     };
 
     return $data;
index a2d58dfc654fa080d0415a5864ea505317f4f26f..54813d9f97c4d4b030844916d4cc5d60ddb9e2a7 100755 (executable)
@@ -393,7 +393,7 @@ sub total_mail_stat {
     my $cmds = "SELECT sum(CountIn) + $glcount AS count_in, sum(CountOut) AS count_out, " .
        "sum (VirusIn) AS viruscount_in, sum (VirusOut) AS viruscount_out, " .
        "sum (SpamIn) AS spamcount_in, sum (SpamOut) AS spamcount_out, " .
-       "sum (BytesIn) AS bytes_in, sum (BytesOut) AS bytes_out, " .
+       "sum (BytesIn)*1024*1024 AS bytes_in, sum (BytesOut)*1024*1024 AS bytes_out, " .
        "sum (BouncesIn) AS bounces_in, sum (BouncesOut) AS bounces_out, " .
        "sum (GreylistCount) + $glcount as glcount, " .
        "sum (SPFCount) as spfcount, " .