             t (or (event :time) (unix-time))]
         (bin event t)))))
 
-; Partitions events by time (fast variant). Over interval seconds, adds events
-; to a bin, created with (create). When the interval is complete, calls (finish
-; bin start-time end-time)
-;
 ; This leaks a thread. Need to think about dynamic scheduling/expiry.
 (defn part-time-fast [interval create add finish]
+ "Partitions events by time (fast variant). Over interval seconds, adds events
+  to a bin, created with (create). When the interval is complete, calls (finish
+  bin start-time end-time)"
   (let [current (ref (create))
         start (ref (unix-time))
         switcher (.start (new Thread (bound-fn []

              true)))
        (call-rescue event children)))))

; Passes on events only when their metric falls within the given inclusive
; range. (within [0 1] (fn [event] do-something))
(defn within [r & children]
  (fn [event]
    (when (<= (first r) (:metric_f event) (last r))
      (call-rescue event children))))

  (:use [clojure.contrib.math])
  (:use [clojure.contrib.logging]))

(defmacro call-rescue [event children]
  "Call each child, in order, with event. Rescues and logs any failure."
  `(do
     (doseq [child# ~children]
       (try
