Permalink
Browse files

Support graphite-prefix.

  • Loading branch information...
1 parent ee75207 commit 84de2807aa0d4e60519ef5655f796dc4b6941ce4 @technomancy technomancy committed Oct 2, 2012
Showing with 4 additions and 2 deletions.
  1. +1 −0 src/pulse/conf.clj
  2. +3 −2 src/pulse/emitter.clj
View
@@ -18,3 +18,4 @@
(defn canonical-host [] (env! "CANONICAL_HOST"))
(defn publish-threads [] (Integer. (env! "PUBLISH_THREADS")))
(defn merger-count [] (Integer. (or (env "MERGER_COUNT") 5)))
+(defn graphite-prefix [] (env "GRAPHITE_PREFIX"))
View
@@ -13,11 +13,12 @@
(atom '()))
(defn post [metrics-url stats]
- (let [{:keys [host]} (util/url-parse metrics-url)]
+ (let [{:keys [host]} (util/url-parse metrics-url)
+ stats (map #(update-in % [:name] (partial str (conf/graphite-prefix))) stats)]
(log :fn "post" :at "start" :host host)
(try
(http/post metrics-url
- {:body (json/generate-string stats)
+ {:body (json/generate-string stats)
:socket-timeout 5000
:conn-timeout 5000
:content-type :json})

0 comments on commit 84de280

Please sign in to comment.