                                                requests
                                                pause-between-requests
                                                parsed-handler)]
+          (if csv
+            (with-open [csv-writer (io/writer csv)]
+              (let [raw-results (get load-test-results "RawResults")
+                    lines (map #(join "," %) raw-results)
+                    content (join "\n" lines)]
+                (println (str "Writing CSV " csv))
+                (.write csv-writer content))))
           (println (str "Average: " (get load-test-results "Averages")))
           (println (str "Minimum: " (get load-test-results "Minimums")))
           (println (str "Maximum: " (get load-test-results "Maximums")))

  (:require [clj-http.client :as client]
            [clojure.tools.cli :refer [parse-opts]]
            [clojure.java.io :as io]
            [clojure.string :refer [split]]
            [clojure.data.json :as json])
  (:gen-class))


    :default nil]

   ["-h" "--help"]

   [nil "--csv FILE" "Spit out a CSV file with raw timings."
    :id :csv]

   ["-v" "--verbose"]])

