   (:require [clj-http.client :as http]
             [clojure.java.io :as io]))
 
-(declare send-requests response-log)
+(declare send-requests)
 
 (defn run-load-test
   "Execute load test against given URL

(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]
              (.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 response-log-agent 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 % response-log-agent log-writer num-threads))
        )))


