[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r3787 - in trunk/OpenDNSSEC/signer/src: daemon signer

Matthijs Mekking matthijs at nlnetlabs.nl
Wed Aug 25 15:59:50 CEST 2010


Author: matthijs
Date: 2010-08-25 15:59:49 +0200 (Wed, 25 Aug 2010)
New Revision: 3787

Modified:
   trunk/OpenDNSSEC/signer/src/daemon/engine.c
   trunk/OpenDNSSEC/signer/src/signer/stats.c
   trunk/OpenDNSSEC/signer/src/signer/stats.h
   trunk/OpenDNSSEC/signer/src/signer/tools.c
Log:
total time stats pivotal story http://www.pivotaltracker.com/story/show/4674693

Modified: trunk/OpenDNSSEC/signer/src/daemon/engine.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/daemon/engine.c	2010-08-25 11:41:11 UTC (rev 3786)
+++ trunk/OpenDNSSEC/signer/src/daemon/engine.c	2010-08-25 13:59:49 UTC (rev 3787)
@@ -621,8 +621,8 @@
     if (zone_name) {
         se_log_debug("zone %s not found", zone_name);
         if (buf) {
-            (void)snprintf(buf, ODS_SE_MAXLINE, "Zone %s not found.\n",
-                zone_name);
+            (void)snprintf(buf, ODS_SE_MAXLINE, "Zone %s not found, "
+                updating all zones.\n", zone_name);
         }
     } else {
         se_log_debug("configurations updated");

Modified: trunk/OpenDNSSEC/signer/src/signer/stats.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/signer/stats.c	2010-08-25 11:41:11 UTC (rev 3786)
+++ trunk/OpenDNSSEC/signer/src/signer/stats.c	2010-08-25 13:59:49 UTC (rev 3787)
@@ -63,6 +63,8 @@
     stats->sig_count = 0;
     stats->sig_reuse = 0;
     stats->sig_time = 0;
+    stats->start_time = 0;
+    stats->end_time = 0;
 }
 
 
@@ -83,11 +85,13 @@
 
     se_log_info("[STATS] %s RR[count=%u time=%u(sec)) "
         "NSEC%s[count=%u time=%u(sec)] "
-        "RRSIG[new=%u reused=%u time=%u(sec) avg=%u(sig/sec)]",
+        "RRSIG[new=%u reused=%u time=%u(sec) avg=%u(sig/sec)] "
+        "TOTAL[time=%u(sec)] ",
         name?name:"(null)", stats->sort_count, stats->sort_time,
         nsec_type==LDNS_RR_TYPE_NSEC3?"3":"", stats->nsec_count,
         stats->nsec_time,
-        stats->sig_count, stats->sig_reuse, stats->sig_time, avsign);
+        stats->sig_count, stats->sig_reuse, stats->sig_time, avsign,
+        (uint32_t) (stats->end_time - stats->start_time));
     return;
 }
 

Modified: trunk/OpenDNSSEC/signer/src/signer/stats.h
===================================================================
--- trunk/OpenDNSSEC/signer/src/signer/stats.h	2010-08-25 11:41:11 UTC (rev 3786)
+++ trunk/OpenDNSSEC/signer/src/signer/stats.h	2010-08-25 13:59:49 UTC (rev 3787)
@@ -59,6 +59,8 @@
     uint32_t    sig_count;
     uint32_t    sig_reuse;
     time_t      sig_time;
+    time_t      start_time;
+    time_t      end_time;
 };
 
 /**

Modified: trunk/OpenDNSSEC/signer/src/signer/tools.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/signer/tools.c	2010-08-25 11:41:11 UTC (rev 3786)
+++ trunk/OpenDNSSEC/signer/src/signer/tools.c	2010-08-25 13:59:49 UTC (rev 3787)
@@ -66,6 +66,7 @@
     zone->stats->sort_count = 0;
     zone->stats->sort_time = 0;
     start = time(NULL);
+    zone->stats->start_time = start;
 
     switch (zone->inbound_adapter->type) {
         case ADAPTER_FILE:
@@ -139,6 +140,10 @@
     se_log_assert(zone->stats);
     se_log_verbose("nsecify zone %s", zone->name?zone->name:"(null)");
     start = time(NULL);
+    if (!zone->stats->start_time) {
+        zone->stats->start_time = start;
+    }
+
     error = zone_nsecify(zone);
     end = time(NULL);
     zone->stats->nsec_time = (end-start);
@@ -162,6 +167,9 @@
     se_log_assert(zone->stats);
     se_log_verbose("sign zone %s", zone->name?zone->name:"(null)");
     start = time(NULL);
+    if (!zone->stats->start_time) {
+        zone->stats->start_time = start;
+    }
     error = zone_sign(zone);
     end = time(NULL);
     zone->stats->sig_time = (end-start);
@@ -251,6 +259,8 @@
     }
 
     /* log stats */
+    zone->stats->end_time = time(NULL);
+
     se_log_debug("log stats for zone %s", zone->name?zone->name:"(null)");
     stats_log(zone->stats, zone->name, zone->signconf->nsec_type);
     stats_clear(zone->stats);




More information about the Opendnssec-commits mailing list