    [s7p.master.core :refer [remove-dsp create-dsp change-qps start-query stop-query qp100ms timer]]))
 
 
-(def testing? (atom 1))
+(def testing (atom 1))
+(def queries (atom nil))
+
+(defn running? []
+  @queries)
+
+(defn testing? []
+  (= @testing 1))
 
 (defn page []
   (html

             (submit-button "new dsp")])
   (form-to [:post "/control/qps"]
            [:div
             "qps"        [:input {:name :qps :value (* 10 @qp100ms)}]
             (submit-button "change qps")])
   [:div "mode: " (if (= 1 @testing?) "test" "prd")]
   [:div
    [:span "status: "]
    [:ul {:style "list-style: none"}
          [:li {:style "float: left"} (form-to [:post "/control/start"] (submit-button "start"))]
          [:li {:style "float: left"} (form-to [:post "/control/stop"]  (submit-button "stop"))]]]
   [:ul
    (for [dsp @config/dsps]
      [:li (form-to [:post "/dsp/delete"]
                    ;; TODO: visibility
                    [:input {:name :id :visibility :hidden :value (:id dsp)}]
                    [:ul {:style "list-style: none"}
                     [:li {:style "float: left"} (:id dsp)]
                     [:li {:style "float: left"} (:url dsp)]
                     [:li {:style "float: left"} (:winnotice dsp)]
                     (submit-button "delete")])])]))


(defn to-req [line]

     :floorPrice (if (= "NA" fp) nil (Integer. fp))
     :device     (line 2)
     :user       (line 3)
     :test       @testing}
    :result      (mapv #(Integer. %) (subvec line 4))}))


(defn -main [& args]
  (let [context (zmq/zcontext 1)
        ;; somehow cannot use with-open
        in-file (io/reader (first args))
        pub (doto (zmq/socket context :pub)
