[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r3672 - trunk/OpenDNSSEC/signer/src/signer

Matthijs Mekking matthijs at nlnetlabs.nl
Mon Aug 9 10:50:11 CEST 2010


Author: matthijs
Date: 2010-08-09 10:50:11 +0200 (Mon, 09 Aug 2010)
New Revision: 3672

Modified:
   trunk/OpenDNSSEC/signer/src/signer/tools.c
Log:
put back stats and /dev/null in tools.c



Modified: trunk/OpenDNSSEC/signer/src/signer/tools.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/signer/tools.c	2010-08-09 08:43:46 UTC (rev 3671)
+++ trunk/OpenDNSSEC/signer/src/signer/tools.c	2010-08-09 08:50:11 UTC (rev 3672)
@@ -55,10 +55,18 @@
 {
     char* tmpname = NULL;
     int error = 0;
+    time_t start = 0;
+    time_t end = 0;
 
     se_log_assert(zone);
     se_log_assert(zone->inbound_adapter);
     se_log_assert(zone->signconf);
+    se_log_assert(zone->stats);
+
+    zone->stats->sort_count = 0;
+    zone->stats->sort_time = 0;
+    start = time(NULL);
+
     se_log_verbose("read zone %s", zone->name);
 
     /* make a copy (slooooooow, use system(cp) ?) */
@@ -77,6 +85,9 @@
             error = 1;
             break;
     }
+    end = time(NULL);
+    zone->stats->sort_time = (end-start);
+
     return error;
 }
 
@@ -116,11 +127,17 @@
 tools_nsecify(zone_type* zone)
 {
     int error = 0;
+    time_t start = 0;
+    time_t end = 0;
 
     se_log_assert(zone);
     se_log_assert(zone->signconf);
+    se_log_assert(zone->stats);
     se_log_verbose("nsecify zone %s", zone->name);
+    start = time(NULL);
     error = zone_nsecify(zone);
+    end = time(NULL);
+    zone->stats->nsec_time = (end-start);
     return error;
 }
 
@@ -132,10 +149,19 @@
 int
 tools_sign(zone_type* zone)
 {
+    int error = 0;
+    time_t start = 0;
+    time_t end = 0;
+
     se_log_assert(zone);
     se_log_assert(zone->signconf);
+    se_log_assert(zone->stats);
     se_log_verbose("sign zone %s", zone->name);
-    return zone_sign(zone);
+    start = time(NULL);
+    error = zone_sign(zone);
+    end = time(NULL);
+    zone->stats->sig_time = (end-start);
+    return error;
 }
 
 
@@ -164,15 +190,14 @@
         }
 
         if (config->working_dir) {
-            snprintf(str, SYSTEM_MAXLEN, "%s -c %s -s %s/%s -z %s",
+            snprintf(str, SYSTEM_MAXLEN, "%s -c %s -s %s/%s -z %s > /dev/null",
                 ODS_SE_AUDITOR, config->cfg_filename, config->working_dir,
                 finalized, zone->name);
         } else {
-            snprintf(str, SYSTEM_MAXLEN, "%s -c %s -s %s -z %s",
+            snprintf(str, SYSTEM_MAXLEN, "%s -c %s -s %s -z %s > /dev/null",
                 ODS_SE_AUDITOR, config->cfg_filename, finalized, zone->name);
         }
 
-
         se_log_debug("system call: %s", str);
         error = system(str);
         if (!error) {
@@ -195,7 +220,9 @@
     int error = 0;
 
     se_log_assert(zone);
+    se_log_assert(zone->signconf);
     se_log_assert(zone->outbound_adapter);
+    se_log_assert(zone->stats);;
     se_log_verbose("write zone %s", zone->name);
 
     switch (zone->outbound_adapter->type) {
@@ -209,5 +236,11 @@
             error = 1;
             break;
     }
+
+    /* log stats */
+    se_log_debug("log stats for zone %s", zone->name);
+    stats_log(zone->stats, zone->name, zone->signconf->nsec_type);
+    stats_clear(zone->stats);
+
     return error;
 }




More information about the Opendnssec-commits mailing list