diff --git a/src/package.lisp b/src/package.lisp index 3c8b6f5..9b9edc3 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -207,6 +207,7 @@ #:pgtable-initialize-reject-files #:pgtable-secs + #:pgtable-rows #:pgtable-start #:pgtable-stop #:pgtable-reject-data diff --git a/src/sources/common/db-methods.lisp b/src/sources/common/db-methods.lisp index 1d2e3d7..edf62d1 100644 --- a/src/sources/common/db-methods.lisp +++ b/src/sources/common/db-methods.lisp @@ -135,7 +135,7 @@ ;; able to benefit from the indexes. In particular avoid doing that step ;; while CREATE INDEX statements are in flight (avoid locking). ;; - (log-message :notice "Complete PostgreSQL database.") + (log-message :notice "Completing PostgreSQL database.") (when reset-sequences (reset-sequences (clone-connection (target-db copy)) catalog)) diff --git a/src/utils/monitor.lisp b/src/utils/monitor.lisp index 2e4b96c..32eefc7 100644 --- a/src/utils/monitor.lisp +++ b/src/utils/monitor.lisp @@ -238,6 +238,21 @@ :rs (update-stats-rs event) :ws (update-stats-ws event)) + ;; log some kind of a “keep alive” message to the user, for + ;; the sake of showing progress. + ;; + ;; something like one message every 20 batches should only + ;; target big tables where we have to wait for a pretty long + ;; time. + (when (and (update-stats-rows event) + (typep label 'pgloader.catalog:table) + (< (* 19 *copy-batch-rows*) + (mod (pgtable-rows table) + (* 20 *copy-batch-rows*)))) + (log-message :notice "copy ~a: ~d rows done" + (pgloader.catalog:format-table-name label) + (pgtable-rows table))) + (when (update-stats-start event) (log-message :debug "start ~a ~30t ~a" (pgloader.catalog:format-table-name label)