Skip to content

Instantly share code, notes, and snippets.

/ab
Created Nov 3, 2010

Embed
What would you like to do?
AB test.
Server Software: aleph
Server Hostname: localhost
Server Port: 9292
Document Path: /
Document Length: 6 bytes
Concurrency Level: 50
Time taken for tests: 9.565 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 830000 bytes
HTML transferred: 60000 bytes
Requests per second: 1045.45 [#/sec] (mean)
Time per request: 47.826 [ms] (mean)
Time per request: 0.957 [ms] (mean, across all concurrent requests)
Transfer rate: 84.74 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 11 99.2 0 1003
Processing: 1 34 33.5 24 252
Waiting: 0 33 33.5 23 251
Total: 1 45 103.4 25 1053
(ns alpha.core
(:require [redis.core :as redis])
(:gen-class))
(use `aleph.core 'aleph.http)
(defn store_request [request]
(redis/with-server
{:host "127.0.0.1" :port 6379 :db 0}
(do
(let [headers (request :headers)]
(let [user-agent (headers "user-agent")]
(do
(println "Sending ping")
(println "Reply: " (redis/ping))
(println "Setting key 'useragent'")
(println "Reply: " (redis/set (. System (nanoTime)) user-agent))
))))))
(defn alpha [channel request]
(let [] (enqueue-and-close channel
{:status 200
:header {"Content-Type" "text/html"}
:body "Noted!"})
(store_request request)))
(defn -main [& args]
(start-http-server alpha {:port 9292}))
[40906] 03 Nov 12:02:34 - DB 0: 50019 keys (0 volatile) in 65536 slots HT.
[40906] 03 Nov 12:02:34 - 8 clients connected (0 slaves), 11211488 bytes in use
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.