 (defn- send-response-log
   "Function that will 'send-off' for asynchronously logging response metrics.
    This function itself should not nothing blocking."
-  [time-in-millis log-writer num-threads]
-  (send-off response-log (fn [count]
+  [time-in-millis response-log-agent log-writer num-threads]
+  (send-off response-log-agent (fn [count]
               (.write log-writer (str "timestamp:" (System/currentTimeMillis) " threads: " num-threads " duration: " time-in-millis "\n"))
               (if (= 10 count) 
                 (do 


(defn- send-requests
  "Send an HTTP request 'count' times and log metrics after each response."
  [url count log-writer num-threads]
  (dotimes [n count] 
      (let
        ; we generate a random id to seed the request with a different arg each request
        [url (str url "?id=" (rand-int 999999))]
        ; perform http/get inside duration-in-millis macro which passes the
        ; duration of the http/get function to the following function 
        (duration-in-millis (http/get url) #(send-response-log % log-writer num-threads))
        )))



  (:require [clj-http.client :as http]
            [clojure.java.io :as io]))

(declare send-requests)

(defn run-load-test
  "Execute load test against given URL
