   member represents one timing category from the request. So, if you're querying a JSON API that
   surfaces a bit of timing information in the response, you might query that JSON and generate a
   vector from the information you find there in your handler."
-  [url number-of-requests pause-between-requests handler]
+  [request-invoker number-of-requests pause-between-requests handler]
   (let [request-indicies (range number-of-requests)
         request-delays (map #(* % pause-between-requests) request-indicies)
-        request-futures (map #(issue-timed-request url % handler) request-delays)
+        request-futures (map #(issue-timed-request request-invoker % handler) request-delays)
         result-timings (map #(deref %) request-futures)
         grouped-result-categories (partition (count result-timings) (apply interleave result-timings))
         average-timing-per-category (map #(-> % (average) (str "ms")) grouped-result-categories)]

      :else
      (let [{requests :requests
             seconds :time
             handler :handler} (:options parsed-options)
            [url] (:arguments parsed-options)
            milliseconds (* seconds 1000)
            pause-between-requests (/ milliseconds requests)
            [parsed-handler custom-handler-name] (if-not (nil? handler)
                                                   [(eval (read (PushbackReader. (io/reader handler))))
                                                    handler]

  (int (/ (apply + numbers) (count numbers))))

(defn- issue-timed-request
  "Issue a timed request by invoking request-invoker within a future after sleeping the future for a
  specified amount of time. Then pass the elapsed time and the content of the request through the
  `handler` to get a vector of timing results - where each member of the vector represents one
  category timing."
  [request-invoker pause handler]
  (future (let [slept (Thread/sleep pause)
                start (System/nanoTime)
                content (request-invoker)
                stop (System/nanoTime)
                elapsed-time-in-ms (int (/ (- stop start) 1000000))]
            (handler elapsed-time-in-ms content))))

(defn- load-test-url
  "Execute number-of-requests requests using the request-invoker with a pause-between-requests pause between
  them. This execution happens in futures so that if we're simulating a decent amount of load that
  load should be able to happen in parallel.
  
