innd/innd.h, innd/timer.c

Igor Timkin ivt at gamma.ru
Fri Oct 27 00:32:12 UTC 2000


1. Remove depreciated artlink.
2. Add ifdef for perl and python.
3. Write non zero counts only (for peering hosts overv always 0).

--- innd/innd.h.OLD	Wed Oct 18 13:00:52 2000
+++ innd/innd.h	Fri Oct 27 03:55:14 2000
@@ -389,13 +389,16 @@
     TMR_HISSYNC,                /* Syncing history to disk. */
     TMR_ARTCLEAN,               /* Analyzing an incoming article. */
     TMR_ARTWRITE,               /* Writing an article. */
-    TMR_ARTLINK,                /* Linking an article (tradspool). */
     TMR_ARTCTRL,                /* Processing a control message. */
     TMR_ARTCNCL,                /* Processing a cancel message. */
     TMR_SITESEND,               /* Sending an article to feeds. */
     TMR_OVERV,                  /* Generating overview information. */
+#if defined(DO_PERL)
     TMR_PERL,                   /* Perl filter. */
+#endif
+#if defined(DO_PYTHON)
     TMR_PYTHON,                 /* Python filter. */
+#endif
     TMR_MAX
 };
 
--- innd/timer.c.OLD	Thu Oct 26 13:01:05 2000
+++ innd/timer.c	Fri Oct 27 04:04:31 2000
@@ -42,8 +42,14 @@
    the definition of enum timer in innd.h. */
 static const char * const timer_name[TMR_MAX] = {
     "idle", "hishave", "hisgrep", "hiswrite", "hissync",
-    "artclean", "artwrite", "artlink", "artctrl", "artcncl",
-    "sitesend", "overv", "perl", "python"
+    "artclean", "artwrite", "artctrl", "artcncl",
+    "sitesend", "overv"
+#if defined(DO_PERL)
+    , "perl"
+#endif
+#if defined(DO_PYTHON)
+    , "python"
+#endif
 };
 
 /* Timer values.  start stores the time (relative to the last summary) at
@@ -103,13 +109,15 @@
 
     length -= sprintf(buffer, "ME time %ld ", get_time(true));
     for (i = 0; i < TMR_MAX; i++) {
-        length -= sprintf(result, "%s %lu(%lu) ", timer_name[i],
-                          cumulative[i], count[i]);
-        if (length < 0)
-            break;
-        strcat(buffer, result);
-        cumulative[i] = 0;
-        count[i] = 0;
+	if (cumulative[i] != 0 || count[i] != 0) {
+	    length -= sprintf(result, "%s %lu(%lu) ", timer_name[i],
+			      cumulative[i], count[i]);
+	    if (length < 0)
+		break;
+	    strcat(buffer, result);
+	    cumulative[i] = 0;
+	    count[i] = 0;
+        }
     }
     syslog(LOG_NOTICE, "%s", buffer);
 }



More information about the inn-patches mailing list