From:	ADVAX::"mcnc!VM1.NoDak.EDU!fac2%DAYTON.SAIC.COM" "Earle Ake" 16-FEB-1991 07:50:10.32
To:	Multiple recipients of list ANU-NEWS <ANU-NEWS@NDSUVM1>
CC:	
Subj:	Re: Patch to NNTP_XMIT.C to get transfer stats

Received: by ADVAX.DECnet (utk-mail11 v1.5) ; Sat, 16 Feb 91 07:49:28 EST
Received:  from mcnc by ge-dab.GE.COM (5.61/GE-DAB 1.15) with UUCP
	id AA16951 for ; Sat, 16 Feb 91 07:45:59 -0500
Received: from VM1.NoDak.EDU by mcnc.mcnc.org (5.59/MCNC/6-11-90)
	id AA28894; Thu, 14 Feb 91 23:52:39 -0500
	for ARISIA.DNET.ge.com!EVERHART
Message-Id: <9102150452.AA28894@mcnc.mcnc.org>
Received: from NDSUVM1.BITNET by VM1.NoDak.EDU (IBM VM SMTP R1.2.1MX) with BSMTP id 4726; Thu, 14 Feb 91 22:51:19 CST
Received: from NDSUVM1.BITNET by NDSUVM1.BITNET (Mailer R2.07) with BSMTP id
 8783; Thu, 14 Feb 91 22:51:16 CST
Date:         Thu, 14 Feb 91 12:23:07 GMT
Reply-To: Earle Ake <mcnc!VM1.NoDak.EDU!fac2%DAYTON.SAIC.COM>
Sender: ANU-NEWS Discussion <ANU-NEWS@VM1.NoDak.EDU>
From: Earle Ake <mcnc!VM1.NoDak.EDU!fac2%DAYTON.SAIC.COM>
Subject:      Re: Patch to NNTP_XMIT.C to get transfer stats
To: Multiple recipients of list ANU-NEWS <ANU-NEWS@NDSUVM1>
 
In article <1991Feb13.210211.1505@dayton.saic.com>, fac2@dayton.saic.com (Earle
Ake) writes:
 
[lines deleted]
 
        I thought about it last night and realized that if 'x' number of
articles were offered and none were accepted then 0 bytes would have been
tranferred in 0 seconds making and throughput of 0/0 (divide by zero error).
I changed the last piece of code to print out only if time != 0.
 
 
*** [-.old_src]nntp_xmit.c
--- nntp_xmit.c
**************
*** 1230,1235
      fpl = fopen(logfile,"a+");
      fprintf(fpl,"%s %s: nntpxmit: %s %d offered %d accepted %d rejected %d fai
led %d expired\n",
                datum, lhost, node, offered, accepted, rejected, failed, expired
);
      fclose(fpl);
      }
    if (debugging) fclose(fpd);
--- 1238,1247 -----
      fpl = fopen(logfile,"a+");
      fprintf(fpl,"%s %s: nntpxmit: %s\n  %d offered %d accepted %d rejected %d
failed %d expired\n",
                datum, lhost, node, offered, accepted, rejected, failed, expired
);
+     if (elapsed_time > 0) {
+     fprintf(fpl,"Transferred %d bytes in %d seconds",
+               total_bytes_sent, elapsed_time);
+     fprintf(fpl," = %d bytes/Second\n",
+               total_bytes_sent/elapsed_time);
+     }
      fclose(fpl);
      }
    if (debugging) fclose(fpd);
 
 
Earle
_____________________________________________________________________________
             ____ ____    ___
Earle Ake   /___ /___/ / /     Science Applications International Corporation
           ____//   / / /__                 Dayton, Ohio
-----------------------------------------------------------------------------
Internet: fac2@dayton.saic.com             uucp: dayvb!fac2
