Parcourir la source

[2380] showed the number of loaded RRs and loading time, best effort basis.

JINMEI Tatuya il y a 12 ans
Parent
commit
ed47bd7238
2 fichiers modifiés avec 11 ajouts et 2 suppressions
  1. 3 1
      src/bin/loadzone/loadzone.py.in
  2. 8 1
      src/bin/loadzone/loadzone_messages.mes

+ 3 - 1
src/bin/loadzone/loadzone.py.in

@@ -284,7 +284,9 @@ class LoadZoneRunner:
             self._set_signal_handlers()
             self._parse_args()
             self._do_load()
-            logger.info(LOADZONE_DONE, self._zone_name, self._zone_class)
+            total_elapsed_txt = "%.2f" % (time.time() - self.__start_time)
+            logger.info(LOADZONE_DONE, self.__loaded_rrs, self._zone_name,
+                        self._zone_class, total_elapsed_txt)
             self._post_load_checks()
             return 0
         except BadArgument as ex:

+ 8 - 1
src/bin/loadzone/loadzone_messages.mes

@@ -27,9 +27,16 @@ LOADZONE_ZONE_CREATED), but the loading operation has subsequently
 failed.  The newly created zone has been removed from the data source,
 so that the data source will go back to the original state.
 
-% LOADZONE_DONE Load zone %1/%2 completed
+% LOADZONE_DONE Loadded (at least) %1 RRs into zone %2/%3 in %4 seconds
 b10-loadzone has successfully loaded the specified zone.  If there was
 an old version of the zone in the data source, it is now deleted.
+It also prints (a lower bound of) the number of RRs that have been loaded
+and the time spent for the loading.  Due to a limitation of the
+current implementation of the underlying library however, it cannot show the
+exact number of the loaded RRs; it's counted for every N-th RR where N
+is the value of the -i command line option.  So, for smaller zones that
+don't even contain N RRs, the reported value will be 0.  This will be
+improved in a future version.
 
 % LOADZONE_LOAD_ERROR Failed to load zone %1/%2: %3
 Loading a zone by b10-loadzone fails for some reason in the middle of