         (catch Exception e
           (wlog/unhandled-error e))
         (finally
-          (when mstore
-            (show-stats "Metric store stats" {:processed @mstore-processed
-                                              :error-paths @mstore-error-paths}
-                        (mstore/get-stats mstore))
-            (mstore/shutdown mstore))
-          (when pstore
-            (show-stats "Path store stats" {:processed @pstore-processed
-                                            :error-paths @pstore-error-paths}
-                        (pstore/get-stats pstore))
-            (pstore/shutdown pstore)))))
+          (show-stats mstore pstore)
+          (shutdown mstore pstore))))
     (catch Exception e
       (wlog/unhandled-error e)))
   (wlog/exit 0))

    (println "  Processed:   " processed)
    (println "  Store errors:" (count (:error-paths store-stats)))
    (println "  Data errors: " data-errors)))

(defn- process
  "Process a Whisper database."

;;     (assoc merged :error-paths (clojure.set/union (:error-paths total)
;;                                                   (:error-paths store)))))

(defn- show-store-stats
  "Show store stats."
  [title data-stats store-stats]
  (let [processed (:processed data-stats)
        data-errors (count (:error-paths data-stats))
