🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
1 messages
1 total messages Started by Per Hedeland Sun, 10 Nov 1996 00:00
Innd patch for logwatchers
#12219
Author: Per Hedeland
Date: Sun, 10 Nov 1996 00:00
68 lines
3158 bytes
If you've never looked at the "news" log file to see how fast the
articles are *really* arriving, this patch is not for you. I've done
that on occasion though, and found that with streaming inbound feeds,
the timestamps get rather silly - a dozen or so articles arriving at the
same millisecond, and then seconds before the next bunch arrives, at
another millisecond.

What the patch (relative to 1.4unoff4) does is waste some number of CPU
microseconds per article to get a more "realistic" timestamp - perhaps
someone else finds it useful...:-)

--Per Hedeland
per@erix.ericsson.se

*** innd/art.c.ORIG	Mon Mar  4 17:21:48 1996
--- innd/art.c	Thu Sep 12 10:09:59 1996
***************
*** 1031,1049 ****
  {
      int			i;
      BOOL		Done;
  
      /* We could be a bit faster by not dividing Now.usec by 1000,
       * but who really wants to log at the Microsec level? */
      Done = code == ART_ACCEPT || code == ART_JUNK;
      if (text)
  	i = fprintf(Log, "%.15s.%03.3d %c %s %s %s%s",
! 		ctime(&Now.time) + 4, (int)(Now.usec / 1000),
  		code, Data->Feedsite,
  		Data->MessageID == NULL ? "(null)" : Data->MessageID,
  		text, Done ? "" : "\n");
      else
  	i = fprintf(Log, "%.15s.%03.3d %c %s %s%s",
! 		ctime(&Now.time) + 4, (int)(Now.usec / 1000),
  		code, Data->Feedsite,
  		Data->MessageID == NULL ? "(null)" : Data->MessageID,
  		Done ? "" : "\n");
--- 1031,1057 ----
  {
      int			i;
      BOOL		Done;
+     TIMEINFO		ReallyNow;
  
      /* We could be a bit faster by not dividing Now.usec by 1000,
       * but who really wants to log at the Microsec level? */
+     /* Indeed, however streaming makes even the millisecs pointless
+        as Now is updated too seldom - let's give that expensive CPU
+        something to do while it is waiting for disk I/O. Of course
+        this means that the time logged is when the article was written
+        to disk rather than when it arrived on the NNTP port.:-) */
+     if (GetTimeInfo(&ReallyNow) < 0)
+ 	syslog(L_ERROR, "%s cant gettimeinfo %m", LogName);
      Done = code == ART_ACCEPT || code == ART_JUNK;
      if (text)
  	i = fprintf(Log, "%.15s.%03.3d %c %s %s %s%s",
! 		ctime(&ReallyNow.time) + 4, (int)(ReallyNow.usec / 1000),
  		code, Data->Feedsite,
  		Data->MessageID == NULL ? "(null)" : Data->MessageID,
  		text, Done ? "" : "\n");
      else
  	i = fprintf(Log, "%.15s.%03.3d %c %s %s%s",
! 		ctime(&ReallyNow.time) + 4, (int)(ReallyNow.usec / 1000),
  		code, Data->Feedsite,
  		Data->MessageID == NULL ? "(null)" : Data->MessageID,
  		Done ? "" : "\n");

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads