[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: scheduler.perflog
On Mon, Jun 21, 2004 at 03:21:53PM +0100, Simon Brock wrote:
> I recently upgraded a machine from a 2.99.56 pre version to an actual
> and then discovered that the perflog format had changed -- sigh.
>
> We run a newsletter system here and we were processing the old file
> format that looked like this:
>
> timestamp fileid dt1 dt2 state $channel/$host
>
> to get the fileid and update a database table with delivery time and
> success information. I could do this from the fileid as our software
> created the file ids. The new format does not have the fileid (or
> the timestamp) and therefore I cannot do this.
>
> So three questions:
>
> -- can anyone think of another way of doing this? I thought about
> going from the maillog but I need to cross reference to the perflog.
The first two fields have been merged into "spoolid" that is
present all over the place:
http://www.zmailer.org/cgi-bin/cvsweb.cgi/zmailer/scheduler/update.c.diff?r1=1.67;r2=1.68
--- zmailer/scheduler/update.c 2002/02/01 11:09:25 1.67
+++ zmailer/scheduler/update.c 2003/03/12 22:50:56 1.68
@@ -556,8 +556,8 @@ static void logstat(vp,reason)
if (!statuslog) return;
mytime(&now);
- sfprintf(statuslog, "%ld %s %ld %ld %s %s/%s\n",
- (long)vp->cfp->mtime, vp->cfp->mid,
+ sfprintf(statuslog, "%s %ld %ld %s %s/%s\n",
+ vp->cfp->spoolid,
(long)(vp->cfp->envctime - vp->cfp->mtime),
(long)(now - vp->cfp->envctime), reason,
vp->orig[L_CHANNEL]->name,vp->orig[L_HOST]->name);
> -- I think I can just amend update.c to use the old format without
> breaking anything else. Is this right?
Yes, reverse the diff above.
Alternate is to use same spoolid generation logic that e.g.
mail-submit uses in smtpserver. See taspoolid() calls within
file smtpserver/smtpdata.c for data source, and its conversion
to the "spoolid" string. Essentially it is encoded form of
above-presented 'mtime' and the 'mid' parts in a form something
like this sprintf pattern:
sprintf(buf, "S%s%s", mid, encoded_timestamp)
The actual encoder implementation is in lib/taspoolid.c file.
> -- if I do the latter, is it worth doing properly (i.e. sending in a
> patch). Does anyone else miss the old format?
Didn't even know that somebody wanted it... It was just a debug tool.
> TIA,
> Simon.
--
/Matti Aarnio <mea@nic.funet.fi>
-
To unsubscribe from this list: send the line "unsubscribe zmailer" in
the body of a message to majordomo@nic.funet.fi