bruce@sonyd1.Broadcast.Sony.COM (Bruce Lilly) (09/18/90)
I've noticed two problems regarding the statistics on mailer
use/message size as stored in sendmail.st by sendmail, and
reported by mailstats. The following changes were made to
sendmail 5.64 with IDA enhancements, but I believe they apply to
vanilla 5.64 (and probably earlier versions) also.
1) The size, reported in increments of approximately 1Kbyte,
is excessive. A one byte message would be reported as
1K. A solution to this is to change the #define of
KBYTES(x) in stats.c to:
#define KBYTES(x) (((x) + (ONE_K / 2)) / ONE_K)
This is not an ideal solution, but assuming message sizes
are randomly distributed, it should be more accurate than
the unmodified sources. (Note that in this case, small
messages are not counted at all.)
2) If the default delivery mode is b(ackground), the
msgsfr count is incorrect (messages are counted twice).
The cause is that the Stat structure (stats.c) is updated
by a call from main() to markstats(), then written to the
statistics file both in main() (poststats() called by
finis()) *and* in the process forked for delivery in
sendall() (which also calls finis()). The solution is to
move the call (in main() in main.c) of markstats() to
after the call of sendall() (near the end of main()).
Consequently, the nf element of the Stat structure is not
set in the version written by the forked process (it is
still written by the original process).
--
Bruce Lilly, Product Manager, | bruce@sonyd1.Broadcast.Sony.COM
Digital Television Tape Recording, | uunet!{sonyusa,vmp}!sonyd1!bruce
Sony Communications Products Co., | lilb@sony.compuserve.com (slow)
Teaneck, NJ 07666 | Telephone: 1(201)833-5693 | FAX: 1(201)833-9279vixie@wrl.dec.com (Paul Vixie) (09/20/90)
I never use the sendmail.st stuff - all my statistics come from log files. The latest King James Sendmail can keep a log of all the headers of all messages it collects; this combined with the normal syslog stuff is suffic- ient for reports like this: Syslog Input: (total) (mail11) Output Statistics: File Date Msgs Kbytes AvgSz Sndrs Rcips Sent AvgDelay Dferd Que'd Other .0 Sep 18 11287 61721 5600 5134 6955 16520 22:50 1013 3012 557 .1 Sep 17 11044 60813 5639 4282 5676 15334 29:26 798 2887 717 .2 Sep 16 2960 30549 10568 1699 1830 3829 14:15 407 782 1392 .3 Sep 15 5531 17923 3318 1874 2149 7589 15:07 629 619 473 .4 Sep 14 1716 3745 2235 396 444 2893 1:03:23 187 145 84 [...] I'm going to remove the sendmail.st support altogether, since I'm looking for ways to make KJS smaller and this whole mechanism seems primative and useless. Anybody have strong feelings the other way? -- Paul Vixie DEC Western Research Lab <vixie@wrl.dec.com> Palo Alto, California ...!decwrl!vixie