From 21a10235dbee910023fea2a9dffc6f94441ecedd Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Tue, 3 Jan 2017 22:57:43 +0100 Subject: [PATCH] Refrain from issuing the summary twice. Now that we have a proper flush system for reporting the summary at the proper time (see 7c5396f0975be405910d66f4b5aedc89acd75c1d), refrain from also taking care of the reporting when stopping the monitor. Adapt the regression driver code to flush the summary after loading the expected data, which also provides better output. When the summary output is sent to a file, that would also create a backup file and replace our summary with an empty new file at monitor stop... Fixes #499. --- src/regress/regress.lisp | 2 +- src/utils/monitor.lisp | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/regress/regress.lisp b/src/regress/regress.lisp index d1c0d1c..e063565 100644 --- a/src/regress/regress.lisp +++ b/src/regress/regress.lisp @@ -68,7 +68,7 @@ :into expected-data-target :options '(:truncate t) :start-logger nil - :flush-summary nil) + :flush-summary t) ;; now compare both (with-pgsql-connection (target-conn) diff --git a/src/utils/monitor.lisp b/src/utils/monitor.lisp index 25cdde6..3353919 100644 --- a/src/utils/monitor.lisp +++ b/src/utils/monitor.lisp @@ -176,16 +176,13 @@ (stop (cl-log:log-message :info "Stopping monitor") - ;; report the summary now - (destructuring-bind (&key pre data post) *sections* - (unless (and (null pre) (null data) (null post)) - (report-current-summary start-time))) - ;; time to shut down the logger? (when (stop-stop-logger event) (pgloader.logs:stop-logger))) (report-summary + (cl-log:log-message :log "report summary ~@[reset~]" + (report-summary-reset event)) (report-current-summary start-time) (when (report-summary-reset event)