        (map augment-job-instance-with-junit-xml)))
 
 (put-to-buildviz (map make-build-instance job-instances))
+
+(println (format "Done, wrote %s build entries" (count job-instances)))


(require '[cheshire.core :as j]
         '[clj-http.client :as client]
         '[clj-time.format :as tf]
         '[clj-time.coerce :as tc]
         '[clojure.tools.cli :refer [parse-opts]])


(defn job-instances-for-stage [{stage :stage pipeline :pipeline}]
  (map #(assoc % :stageName stage :pipelineName pipeline)
       (take-while #(.isAfter (:scheduledDateTime %) load-builds-from)
                   (mapcat job-instances-for-stage-instance
                           (fetch-all-stage-history pipeline stage)))))


;; /api/pipelines/%pipelines/instance/%run
