diff options
| author | Scott Ostler <scottbot9000@gmail.com> | 2010-08-23 20:04:44 -0400 |
|---|---|---|
| committer | Scott Ostler <scottbot9000@gmail.com> | 2010-08-23 20:04:44 -0400 |
| commit | de21bc98b04e8eb55b9a0448cda311f6c52f89f6 (patch) | |
| tree | ebacc66d2d9fe4da79cbf49c8157fb69f4f9d71a /test/dumpfm/millstone.clj | |
| parent | a70175759c5761f7aa4280280afa44fcb3f85c3b (diff) | |
add perf. test
Diffstat (limited to 'test/dumpfm/millstone.clj')
| -rw-r--r-- | test/dumpfm/millstone.clj | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/dumpfm/millstone.clj b/test/dumpfm/millstone.clj index d972a88..2c1cf4d 100644 --- a/test/dumpfm/millstone.clj +++ b/test/dumpfm/millstone.clj @@ -37,6 +37,7 @@ (= (:code resp) 200)) (defnk do-request! [path + :label nil :params nil :method "GET"] (let [[ms resp] (with-timing @@ -49,6 +50,7 @@ (log (format "Exception for %s - %s" path (.getMessage e))) {:code "?" :msg "EXCEPTION"}))) result {:path path + :label (or label path) :ms ms :error (if (success? resp) nil [(:code resp) (:msg resp)])}] (if (= (rand-int 100) 1) @@ -80,14 +82,14 @@ (/ (count results) (/ elapsed-ms 1000)) (:clients spec))) (let [avg-in-req (/ (sum (map :ms results)) (:clients spec))] - (log (format "\nTime spent in requests per worker : %.02fs (%.02f%%)" + (log (format "\nTime spent in requests (per worker): %.02fs (%.02f%%)" (/ avg-in-req 1000) (* (/ avg-in-req elapsed-ms) 100)))) - (doseq [[path rs] (group-by :path results)] + (doseq [[label rs] (group-by :label results)] (let [nums (map :ms rs) errors (filter identity (map :error rs))] (log (format "\n%s:\n#: %s\nmin: %.02f ms\navg: %.02f ms\nmax: %.02f ms" - path + label (count rs) (apply min nums) (avg nums) |
