From de21bc98b04e8eb55b9a0448cda311f6c52f89f6 Mon Sep 17 00:00:00 2001 From: Scott Ostler Date: Mon, 23 Aug 2010 20:04:44 -0400 Subject: add perf. test --- test/dumpfm/load_test.clj | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'test/dumpfm/load_test.clj') diff --git a/test/dumpfm/load_test.clj b/test/dumpfm/load_test.clj index 2410032..49069e9 100644 --- a/test/dumpfm/load_test.clj +++ b/test/dumpfm/load_test.clj @@ -56,6 +56,25 @@ limit 100 :params params :method "GET"))) +(defn rand-nick [] + (:nick (rand-elt userlist))) + +(defn load-profile [] + (do-request! (str "/" (rand-nick)) + :label "profile")) + +(defn load-popular-profile [] + (do-request! (str "/" (rand-nick)) + :label "popular-profile")) + +(defn load-popular-popular [] + (do-request! (str "/" (rand-elt ["ryder" "jeanette"]) "/popular") + :label "popular-popular")) + +(defn load-popular [] + (do-request! (str "/" (rand-nick) "/popular") + :label "popular")) + (defn chat [] (do-request! "/test/chat")) @@ -75,11 +94,15 @@ limit 100 :method "POST"))) (def test-spec {:server "http://localhost:8080" - :clients 200 + :clients 75 :requests 10000 :max-latency 1000 :setup-func login-client :funcs [[55 refresh] + [10 load-popular] + [10 load-profile] + [3 load-popular-popular] + [3 load-popular-profile] [3 chat] [5 post-msg]] :frequency 1 -- cgit v1.2.3-70-g09d2