Bug#264157: Eximstats: average message size

gregor herrmann gregor herrmann <gregor.herrmann@comodo.priv.at>, 264157@bugs.debian.org
Sat, 07 Aug 2004 13:20:42 +0200


This is a multi-part MIME message sent by reportbug.

--===============1111795970==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Package: exim4-base
Version: 4.34-4
Severity: wishlist
Tags: patch

I thought it would be a nice idea to not only have the count of mails and
the accumulated volume but also the average size of the mails included in
the output of eximstats. I changed the script a bit for local use but only
to show the average values in the HTML output, and there's no additional
section "Top xxx ... by average size" yet which would be nice, too. My
little patch might give you an idea of my thoughts.

Regards,
Gregor


-- Package-specific info:
Exim version 4.34 #1 built 27-Jul-2004 18:08:18
Copyright (c) University of Cambridge 2004
Berkeley DB: Sleepycat Software: Berkeley DB 3.2.9: (May 26, 2004)
Support for: iconv() IPv6 PAM Perl GnuTLS
Lookups: lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmnz dnsdb dsearch ldap ldapdn ldapm mysql nis nis0 passwd pgsql
Authenticators: cram_md5 plaintext spa
Routers: accept dnslookup ipliteral iplookup manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore/mbx autoreply lmtp pipe smtp
Fixed never_users: 0
Contains exiscan-acl patch revision 21 (c) Tom Kistner [http://duncanthrax.net/exiscan/]
Configuration file is /var/lib/exim4/config.autogenerated
# /etc/exim4/update-exim4.conf.conf
#
# Edit this file and /etc/mailname by hand and execute update-exim4.conf
# yourself or use 'dpkg-reconfigure exim4-config'

dc_eximconfig_configtype='internet'
dc_other_hostnames='CONFDIR/domains/domains'
dc_local_interfaces=''
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost=''

CFILEMODE='644'
dc_use_split_config='true'
dc_hide_mailname=''
mailname:colleen.colgarra.priv.at

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.4.26.20040424
Locale: LANG=C, LC_CTYPE=de_AT@euro

Versions of packages exim4-base depends on:
ii  adduser                     3.57         Add and remove users and groups
ii  cron                        3.0pl1-86    management of regular background p
ii  debconf [debconf-2.0]       1.4.29       Debian configuration management sy
ii  exim4-config [exim4-config- 4.34-4       Debian configuration for exim4
ii  libc6                       2.3.2.ds1-13 GNU C Library: Shared libraries an
ii  libdb3                      3.2.9-20     Berkeley v3 Database Libraries [ru
ii  netbase                     4.18         Basic TCP/IP networking system
ii  passwd                      1:4.0.3-30   Change and administer password and

-- debconf information:
  exim4/purge_spool: false
* exim4/move_exim3_spool: true

--===============1111795970==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="eximstats.patch"

--- /usr/sbin/eximstats	2004-07-27 18:08:24.000000000 +0200
+++ /usr/local/bin/eximstats_avg	2004-07-03 14:47:48.000000000 +0200
@@ -1011,3 +1011,3 @@
   print "<table border=1>\n";
-  print "<tr><th>Messages</th><th>Bytes</th><th>\u$text</th>\n";
+  print "<tr><th>Messages</th><th>Bytes</th><th>Average</th><th>\u$text</th>\n";
 
@@ -1016,3 +1016,3 @@
   my $align = ($text !~ /local/i) ? 'right' : 'left';
-  $format = "<tr><td align=\"right\">%d</td><td align=\"right\">%s</td><td align=\"$align\" nowrap>%s</td>\n";
+  $format = "<tr><td align=\"right\">%d</td><td align=\"right\">%s</td><td align=\"right\">%s</td><td align=\"$align\" nowrap>%s</td>\n";
 }
@@ -1029,3 +1029,3 @@
     $htmlkey =~ s/</\&lt\;/g;
-    printf($format, $$m_count{$key}, volume_rounded($$m_data{$key},$$m_data_gigs{$key}), $htmlkey);
+    printf($format, $$m_count{$key}, volume_rounded($$m_data{$key},$$m_data_gigs{$key}), volume_rounded($$m_data{$key}/$$m_count{$key},$$m_data_gigs{$key}), $htmlkey);
   }
@@ -1086,3 +1086,3 @@
   print "<table border=1>\n";
-  print "<tr><th>Messages</th><th>Bytes</th><th>\u$text</th>\n";
+  print "<tr><th>Messages</th><th>Bytes</th><th>Average</th><th>\u$text</th>\n";
 }
@@ -1100,3 +1100,3 @@
     $htmlkey =~ s/</\&lt\;/g;
-    printf($format, $$m_count{$key}, volume_rounded($$m_data{$key},$$m_data_gigs{$key}), $htmlkey);
+    printf($format, $$m_count{$key}, volume_rounded($$m_data{$key},$$m_data_gigs{$key}), volume_rounded($$m_data{$key}/$$m_count{$key},$$m_data_gigs{$key}), $htmlkey);
   }

--===============1111795970==--