 ;;
 ;; The next section contains a series of path matching functions
 
+(def agg-methods ["sum" "avg" "mean" "min" "max" "raw"])
 
 (defmulti aggregate-with
   "This transforms a raw list of points according to the provided aggregation

  [_ data]
  (aggregate-with :avg data))

(defn agg-fn-by-path
  [path]
  (if-let [[_ method] (re-find #"^(sum|avg|mean|min|max|raw)(\.|\-).*" path)]
    (partial aggregate-with (keyword method))
    (partial aggregate-with :avg)))

  (:require [clojure.core.async :as async :refer [alt! chan >! close! go
                                                  timeout >!! go-loop
                                                  dropping-buffer]]
            [clojure.tools.logging :refer [debug info warn error]]
            [clojure.string :as str]))

(defmacro go-forever
  [body]
