Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defn add-prefix [pfx event] (str pfx "." (riemann.graphite/graphite-path-percentiles event)))
  2.  
  3. (let [index (index)
  4.       graph-riemann-metric (graphite {:host "localhost" :path (partial add-prefix "riemann.metrics")})
  5.       graph-other-prefix (graphite {:host "localhost" :path (partial add-prefix "other.prefix")})]
  6.   (streams
  7.     (adjust [:host (fn [host] (clojure.string/replace host #"\." "_"))]
  8.       (smap (fn [event] (assoc event :time (unix-time)))
  9.         (by :host
  10.           (with {:service "host_messages_per_second" :metric 1}
  11.             (rate 1
  12.               index
  13.               graph-riemann-metric
  14.               graph-other-prefix)))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement