    submission.  Also submit a report for the host (if present). This is
    similar to timed-update-host, but always sends the update (doesn't run/skip
    based on the clock)"
-  [{:keys [host lastrun catalog report factset base-url run-interval rand-percentage] :as state}]
-  (let [catalog (some-> catalog update-catalog (maybe-tweak-catalog rand-percentage))
-        report (some-> report update-report-run-fields)
-        factset (some-> factset (update-factset rand-percentage))]
+  [current-ts {:keys [host lastrun catalog report factset
+                      base-url run-interval rand-percentage] :as state}]
+  (let [stamp (jitter current-ts 1800)
+        catalog (some-> catalog
+                        (maybe-tweak-catalog rand-percentage stamp))
+        report (some-> report
+                       (update-report-run-fields stamp))
+        factset (some-> factset
+                        (update-factset rand-percentage stamp))]
     (when catalog (client/submit-catalog base-url 6 (json/generate-string catalog)))
     (when report (client/submit-report base-url 5 (json/generate-string report)))
     (when factset (client/submit-facts base-url 4 (json/generate-string factset)))


(defn maybe-tweak-catalog
  "Slightly tweak the given catalog, returning a new catalog, `rand-percentage`
  percent of the time."
  [catalog rand-percentage]
  (if (< (rand 100) rand-percentage)
    (rand-catalog-mutation catalog)
    catalog))

(defn update-catalog [catalog]
  (assoc catalog "producer_timestamp" (time/now)))

(defn update-report-run-fields
  "configuration_version, start_time and end_time should always change
   on subsequent report submittions, this changes those fields to avoid
   computing the same hash again (causing constraint errors in the DB)"
  [report]
  (assoc report
         "configuration_version" (ks/uuid)
         "start_time" (time/now)
         "end_time" (time/now)
         "producer_timestamp" (time/now)))

(defn randomize-map-leaf
  "Randomizes a fact leaf based on a percentage provided with `rp`."

    (when-not facts (log/info "No facts specified; skipping fact submission"))
    (if-let [num-cmds (:nummsgs options)]
      (submit-n-messages hosts (Long/valueOf num-cmds))
      (let [run-interval (time/minutes (Integer/parseInt (:runinterval options)))
            rand-lastrun (fn [run-interval]
                           (jitter (time/minus (time/now) run-interval)
                                   (time/in-seconds run-interval)))]
        (->> hosts
             (mapv #(agent (merge % {:run-interval run-interval
                                     :lastrun (rand-lastrun run-interval)})))
