]> git.proxmox.com Git - pmg-api.git/commitdiff
total_domain_stat: return bytes instead of mbytes
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 29 Nov 2017 10:55:54 +0000 (11:55 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 29 Nov 2017 10:56:36 +0000 (11:56 +0100)
PMG/API2/Statistics.pm
PMG/Statistic.pm

index 5eef9f713a124261c4da46aae1b5b726998ea9d1..1b50c672703f47cff2a22edb3aa881d36f435cfd 100644 (file)
@@ -661,12 +661,12 @@ __PACKAGE__->register_method ({
                    description => "Outgoing spam mails.",
                    type => 'number',
                },
-               mbytes_in => {
-                   description => "Incoming mail traffic (Mebibytes).",
+               bytes_in => {
+                   description => "Incoming mail traffic (Bytes).",
                    type => 'number',
                },
-               mbytes_out => {
-                   description => "Outgoing mail traffic (Mebibytes).",
+               bytes_out => {
+                   description => "Outgoing mail traffic (Bytes).",
                    type => 'number',
                },
                viruscount_in => {
index 54813d9f97c4d4b030844916d4cc5d60ddb9e2a7..f71f84837308f2991974be49113d72ecd5c49323 100755 (executable)
@@ -484,7 +484,7 @@ sub total_domain_stat {
     my ($from, $to) = $self->localdayspan();
 
     my $query = "SELECT domain, SUM (CountIn) AS count_in, SUM (CountOut) AS count_out," .
-       "SUM (BytesIn) AS mbytes_in, SUM (BytesOut) AS mbytes_out, " .
+       "SUM (BytesIn)*1024*1024 AS bytes_in, SUM (BytesOut)*1024*1024 AS bytes_out, " .
        "SUM (VirusIn) AS viruscount_in, SUM (VirusOut) AS viruscount_out," .
        "SUM (SpamIn) as spamcount_in, SUM (SpamOut) as spamcount_out " .
        "FROM DomainStat where time >= $from AND time < $to " .