   (:require [riemann.streams])
   (:use [clojure.test])
   (:use [clojure.java.shell])
+  (:use [clojure.string :only [trim-newline]])
   (:use [incanter core stats charts]))
 
 (defn git-version
   "Returns a human-readable version name for this commit."
   []
-  (if (re-matches #"^\r+$" (:out (sh "git" "status" "-s")))
+  (if (re-matches #"^\n*$" (:out (sh "git" "status" "-s")))
     ; Unchanged commit.
     (str
-      (:out (sh "git" "show" "-s" "--format=\"%ci\"" "HEAD"))
+      (trim-newline (:out (sh "git" "show" "-s" "--format=%ci" "HEAD")))
       " "
-      (:out (sh "git" "rev-parse" "HEAD" :out "UTF-8")))
+      (trim-newline (:out (sh "git" "rev-parse" "HEAD" :out "UTF-8"))))
 
     ; Changed commit.
     "HEAD"))

         ret# ~expr]
     (/ (- (. System (nanoTime)) start#) 1000000.0)))

(defn latencies
  "Returns [times, latencies] of calling f"
  ([f opts]
   (let [n    (or (:n opts) 100)

      :servers servers
      :streams streams})))

(deftest drop-tcp
         (let [{:keys [core]} (core-package)
               client (tcp-client)]
           (try
             (multigraph
               #(send-event client {:service "test" :metric 0.1})
               {:title "drop tcp events"
                :n 100000})
             (finally
               (stop core)))))

